home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CICA Windows Explosion!
/
The CICA Windows Explosion! - Disc 2.iso
/
programr
/
tkern10.zip
/
SRC\PROCESS.ASM
< prev
next >
Wrap
Assembly Source File
|
1994-07-03
|
94KB
|
4,940 lines
.286p
ifndef ??version
?debug macro
endm
publicdll macro name
public name
endm
$comm macro name,dist,size,count
comm dist name:BYTE:count*size
endm
else
$comm macro name,dist,size,count
comm dist name[size]:BYTE:count
endm
endif
?debug V 301h
?debug S "process.c"
?debug C E9A155E31C0970726F636573732E63
?debug C E948B1AE1C122E2E5C696E636C7564655C737464696F2E68
?debug C E9B0A2B01C182E2E5C696E636C7564655C7379732F746B70726F74+
?debug C 6F2E68
?debug C E90020821B18433A5C4243345C494E434C5544455C77696E646F77+
?debug C 732E68
?debug C E90020821B19433A5C4243345C494E434C5544455C746F6F6C6865+
?debug C 6C702E68
?debug C E90020821B17433A5C4243345C494E434C5544455C7374646C6962+
?debug C 2E68
?debug C E90020821B16433A5C4243345C494E434C5544455C5F646566732E+
?debug C 68
?debug C E90020821B17433A5C4243345C494E434C5544455C6D656D6F7279+
?debug C 2E68
?debug C E90020821B14433A5C4243345C494E434C5544455C6D656D2E68
?debug C E90020821B17433A5C4243345C494E434C5544455C737472696E67+
?debug C 2E68
?debug C E90020821B17433A5C4243345C494E434C5544455C6C6F63616C65+
?debug C 2E68
?debug C E90020821B16433A5C4243345C494E434C5544455C616C6C6F632E+
?debug C 68
?debug C E90020821B17433A5C4243345C494E434C5544455C737464617267+
?debug C 2E68
?debug C E90020821B16433A5C4243345C494E434C5544455C6572726E6F2E+
?debug C 68
?debug C E90FA6AE1C162E2E5C696E636C7564655C7379732F7466696C652E+
?debug C 68
?debug C E9F2A5AE1C182E2E5C696E636C7564655C7379732F746465766963+
?debug C 652E68
?debug C E90FA6AE1C162E2E5C696E636C7564655C7379732F7466696C652E+
?debug C 68
?debug C E95651E31C152E2E5C696E636C7564655C7379732F7461736B2E68
?debug C E9E1B0AE1C162E2E5C696E636C7564655C7379732F696F63746C2E+
?debug C 68
?debug C E984695B1C142E2E5C696E636C7564655C7379735C7474792E68
?debug C E9A8A6AE1C152E2E5C696E636C7564655C7379732F776169742E68
?debug C E92AA6AE1C162E2E5C696E636C7564655C7379732F746B65726E2E+
?debug C 68
PROCESS_TEXT segment word public 'CODE'
PROCESS_TEXT ends
DGROUP group _DATA,_BSS
assume cs:PROCESS_TEXT,ds:DGROUP
_DATA segment word public 'DATA'
d@ label byte
d@w label word
_DATA ends
_BSS segment word public 'BSS'
b@ label byte
b@w label word
_BSS ends
_DATA segment word public 'DATA'
_nTasks label word
db 0
db 0
nProcesses label word
db 0
db 0
nZombies label word
db 0
db 0
ptNext label dword
db 0
db 0
db 0
db 0
ptLast label dword
db 0
db 0
db 0
db 0
ptParent label dword
db 0
db 0
db 0
db 0
htaskParent label word
db 0
db 0
pidParent label word
db 0
db 0
pidChild label word
db 0
db 0
nPIDNext label word
db 3
db 0
_DATA ends
PROCESS_TEXT segment word public 'CODE'
?debug C E8010970726F636573732E63A155E31C
;
; GetTaskInfo(void)
;
?debug L 74
assume cs:PROCESS_TEXT,ds:DGROUP
_GetTaskInfo proc far
?debug B
mov ax,DGROUP
inc bp
push bp
mov bp,sp
push ds
mov ds,ax
sub sp,2
push si
?debug B
;
; {
; HTASK hTask;
; int i;
;
; hTask = GetCurrentTask();
;
?debug L 79
call far ptr GETCURRENTTASK
mov word ptr [bp-4],ax
;
; for (i = 0; i < TNTASK; i++)
;
?debug L 80
xor si,si
jmp short @1@310
@1@58:
;
; {
; if (_tasks[i].hTask == hTask)
;
?debug L 82
mov bx,si
imul bx,bx,74
mov ax,word ptr DGROUP:__tasks[bx]
cmp ax,word ptr [bp-4]
jne short @1@282
;
; {
; /* If the task is in fledgeling mode,
; * don't deliver signals.
; */
; if (_tasks[i].nSignal &&
;
?debug L 87
;
; _tasks[i].iFledgeling == -1)
;
?debug L 88
mov bx,si
imul bx,bx,74
cmp word ptr DGROUP:__tasks[bx+64],0
je short @1@170
mov bx,si
imul bx,bx,74
cmp word ptr DGROUP:__tasks[bx+4],-1
jne short @1@170
;
; {
; (*_tasks[i].intrproc)(_tasks[i].nSignal);
;
?debug L 90
mov bx,si
imul bx,bx,74
push word ptr DGROUP:__tasks[bx+64]
mov bx,si
imul bx,bx,74
call dword ptr DGROUP:__tasks[bx+70]
;
; _tasks[i].nSignal = 0;
;
?debug L 91
mov bx,si
imul bx,bx,74
mov word ptr DGROUP:__tasks[bx+64],0
@1@170:
jmp short @1@226
@1@198:
;
; }
;
;
; while (_tasks[i].iFledgeling != -1)
; i = _tasks[i].iFledgeling;
;
?debug L 96
mov bx,si
imul bx,bx,74
mov si,word ptr DGROUP:__tasks[bx+4]
@1@226:
?debug L 95
mov bx,si
imul bx,bx,74
cmp word ptr DGROUP:__tasks[bx+4],-1
jne short @1@198
jmp short @1@422
@1@282:
?debug L 80
inc si
@1@310:
cmp si,20
jl short @1@58
;
; return &_tasks[i];
; }
; }
; for (i = 0; i < TNTASK; i++)
;
?debug L 100
xor si,si
jmp short @1@478
@1@366:
;
; {
; if (!_tasks[i].hTask)
;
?debug L 102
mov bx,si
imul bx,bx,74
cmp word ptr DGROUP:__tasks[bx],0
jne short @1@450
;
; {
; _tasks[i].hTask = hTask;
;
?debug L 104
mov bx,si
imul bx,bx,74
mov ax,word ptr [bp-4]
mov word ptr DGROUP:__tasks[bx],ax
;
; _tasks[i].pchCreatedBy = ((char **) &hTask)[2];
;
?debug L 105
mov bx,si
imul bx,bx,74
mov dx,word ptr [bp+6]
mov ax,word ptr [bp+4]
mov word ptr DGROUP:__tasks[bx+68],dx
mov word ptr DGROUP:__tasks[bx+66],ax
@1@422:
;
; return &_tasks[i];
;
?debug L 106
mov ax,si
imul ax,ax,74
mov dx,ds
add ax,offset DGROUP:__tasks
jmp short @1@534
@1@450:
?debug L 100
inc si
@1@478:
cmp si,20
jl short @1@366
;
; }
; }
; return 0;
;
?debug L 109
xor dx,dx
xor ax,ax
jmp short @1@534
@1@534:
;
; }
;
?debug L 110
pop si
pop cx
pop ds
pop bp
dec bp
ret
?debug C E31907485441534B5F5F02001E01
?debug C E318000200151904
?debug C E60169040406000005685461736B1802FCFF0000
?debug E
?debug E
_GetTaskInfo endp
;
; inc_pid(short *pid)
;
?debug L 113
assume cs:PROCESS_TEXT,ds:DGROUP
_inc_pid proc far
?debug B
mov ax,DGROUP
inc bp
push bp
mov bp,sp
push ds
mov ds,ax
?debug C E31A000400160400
?debug C E6037069641A0A06000000
?debug B
;
; {
; if (*pid == 32767)
;
?debug L 115
les bx,dword ptr [bp+6]
cmp word ptr es:[bx],32767
jne short @2@86
;
; *pid = 2;
;
?debug L 116
les bx,dword ptr [bp+6]
mov word ptr es:[bx],2
jmp short @2@114
@2@86:
;
; else
; (*pid)++;
;
?debug L 118
les bx,dword ptr [bp+6]
inc word ptr es:[bx]
@2@114:
;
; }
;
?debug L 119
pop ds
pop bp
dec bp
ret
?debug C E6037069641A0A06000000
?debug E
?debug E
_inc_pid endp
PROCESS_TEXT ends
_DATA segment word public 'DATA'
aiExecErrors label word
db 8
db 0
db 14
db 0
db 2
db 0
db 2
db 0
db 14
db 0
db 21
db 0
db 21
db 0
db 14
db 0
db 14
db 0
db 14
db 0
db 21
db 0
db 21
db 0
db 21
db 0
db 21
db 0
db 21
db 0
db 21
db 0
db 26
db 0
db 26
db 0
db 21
db 0
db 14
db 0
db 14
db 0
db 14
db 0
db 14
db 0
db 14
db 0
db 14
db 0
db 14
db 0
db 14
db 0
db 14
db 0
db 14
db 0
db 14
db 0
db 14
db 0
db 14
db 0
db 14
db 0
_nTKExecIn label word
db 0
db 0
_nTKExecOut label word
db 0
db 0
_DATA ends
PROCESS_TEXT segment word public 'CODE'
;
; tkern_exec( char const *pchPath,
;
?debug L 182
assume cs:PROCESS_TEXT,ds:DGROUP
_tkern_exec proc far
?debug B
mov ax,DGROUP
inc bp
push bp
mov bp,sp
push ds
mov ds,ax
sub sp,10
?debug C E31B000400160200
?debug C E31C000400160100
?debug C E60A706368436D644C696E651B0A120000000576+
?debug C 61456E761C0A0E000000067661417267731C0A0A+
?debug C 00000007706368506174681B0A06000000
?debug B
;
; va_list vaArgs,
; va_list vaEnv,
; char const *pchCmdLine)
; {
; struct task *pt;
; char *pchCommand;
; int iNew;
;
; pt = GetTaskInfo();
;
?debug L 191
push cs
call near ptr _GetTaskInfo
mov word ptr [bp-4],dx
mov word ptr [bp-6],ax
;
; if (pt->nFlags & TF_EXEC) /* Attempt to recursively exec */
;
?debug L 192
les bx,dword ptr [bp-6]
test byte ptr es:[bx+60],2
je short @3@114
;
; {
; pt->nError = EAGAIN;
;
?debug L 194
les bx,dword ptr [bp-6]
mov word ptr es:[bx+62],42
jmp @3@646
jmp @3@646
@3@114:
;
; return -1;
; }
; nTKExecIn++;
;
?debug L 197
inc word ptr DGROUP:_nTKExecIn
;
; pt->nFlags |= TF_EXEC;
;
?debug L 198
les bx,dword ptr [bp-6]
or word ptr es:[bx+60],2
;
; Copy_Array(&pt->argv, (char **) vaArgs);
;
?debug L 199
push word ptr [bp+12]
push word ptr [bp+10]
mov ax,word ptr [bp-6]
add ax,52
push word ptr [bp-4]
push ax
call far ptr _Copy_Array
add sp,8
;
; Copy_Array(&pt->envp, (char **) vaEnv);
;
?debug L 200
push word ptr [bp+16]
push word ptr [bp+14]
mov ax,word ptr [bp-6]
add ax,56
push word ptr [bp-4]
push ax
call far ptr _Copy_Array
add sp,8
;
; pchCommand = (char *) malloc(strlen(pchPath) + strlen(pchCmdLine) + 2);
;
?debug L 201
push word ptr [bp+8]
push word ptr [bp+6]
call far ptr _strlen
add sp,4
push ax
push word ptr [bp+20]
push word ptr [bp+18]
call far ptr _strlen
add sp,4
pop dx
add dx,ax
add dx,2
push dx
call far ptr _malloc
pop cx
mov word ptr [bp-8],dx
mov word ptr [bp-10],ax
;
; strcpy(pchCommand, pchPath);
;
?debug L 202
push word ptr [bp+8]
push word ptr [bp+6]
push word ptr [bp-8]
push word ptr [bp-10]
call far ptr _strcpy
add sp,8
;
; if (pchCmdLine)
;
?debug L 203
mov ax,word ptr [bp+18]
or ax,word ptr [bp+20]
je short @3@170
;
; {
; strcat(pchCommand, " ");
;
?debug L 205
push ds
push offset DGROUP:s@
push word ptr [bp-8]
push word ptr [bp-10]
call far ptr _strcat
add sp,8
;
; strcat(pchCommand, pchCmdLine);
;
?debug L 206
push word ptr [bp+20]
push word ptr [bp+18]
push word ptr [bp-8]
push word ptr [bp-10]
call far ptr _strcat
add sp,8
@3@170:
jmp short @3@226
@3@198:
;
; }
; while (ptNext)
; GetMessages(pt); /* We only allow one exec at any one time */
;
?debug L 209
push word ptr [bp-4]
push word ptr [bp-6]
call far ptr _GetMessages
add sp,4
@3@226:
?debug L 208
mov ax,word ptr DGROUP:ptNext
or ax,word ptr DGROUP:ptNext+2
jne short @3@198
;
; ptNext = pt;
;
?debug L 210
mov dx,word ptr [bp-4]
mov ax,word ptr [bp-6]
mov word ptr DGROUP:ptNext+2,dx
mov word ptr DGROUP:ptNext,ax
;
; ptLast = pt;
;
?debug L 211
mov dx,word ptr [bp-4]
mov ax,word ptr [bp-6]
mov word ptr DGROUP:ptLast+2,dx
mov word ptr DGROUP:ptLast,ax
;
; if (ptNext->files[0] == -1 ||
;
?debug L 212
;
; ptNext->files[1] == -1 ||
; ptNext->files[2] == -1)
;
?debug L 214
les bx,dword ptr DGROUP:ptNext
cmp word ptr es:[bx+12],-1
je short @3@338
les bx,dword ptr DGROUP:ptNext
cmp word ptr es:[bx+14],-1
je short @3@338
les bx,dword ptr DGROUP:ptNext
cmp word ptr es:[bx+16],-1
jne short @3@366
@3@338:
;
; MessageBox(0, "Files are all mixed up in exec", 0, MB_OK);
;
?debug L 215
push 0
push ds
push offset DGROUP:s@+2
push 0
push 0
push 0
call far ptr MESSAGEBOX
@3@366:
;
; if (pt->hTask != HTASK_FLEDGELING)
;
?debug L 216
les bx,dword ptr [bp-6]
cmp word ptr es:[bx],-1
je short @3@422
;
; MessageBox(0, "Task is not a fledgeling", 0, MB_OK);
;
?debug L 217
push 0
push ds
push offset DGROUP:s@+33
push 0
push 0
push 0
call far ptr MESSAGEBOX
@3@422:
;
; if (!ptNext)
;
?debug L 218
mov ax,word ptr DGROUP:ptNext
or ax,word ptr DGROUP:ptNext+2
jne short @3@478
;
; MessageBox(0, "I set a NULL ptNext!", 0, MB_OK);
;
?debug L 219
push 0
push ds
push offset DGROUP:s@+58
push 0
push 0
push 0
call far ptr MESSAGEBOX
@3@478:
;
; for (ptParent = pt;
;
?debug L 220
mov dx,word ptr [bp-4]
mov ax,word ptr [bp-6]
mov word ptr DGROUP:ptParent+2,dx
jmp short @3@534
@3@506:
;
; ptParent->hTask == HTASK_FLEDGELING;
; ptParent = _tasks + ptParent->iParent);
;
?debug L 222
les bx,dword ptr DGROUP:ptParent
mov ax,word ptr es:[bx+6]
imul ax,ax,74
add ax,offset DGROUP:__tasks
mov word ptr DGROUP:ptParent+2,ds
@3@534:
mov word ptr DGROUP:ptParent,ax
?debug L 221
les bx,dword ptr DGROUP:ptParent
cmp word ptr es:[bx],-1
je short @3@506
;
; htaskParent = ptParent->hTask;
;
?debug L 223
les bx,dword ptr DGROUP:ptParent
mov ax,word ptr es:[bx]
mov word ptr DGROUP:htaskParent,ax
;
; _tasks[pt->iParent].iFledgeling = -1;
;
?debug L 224
les bx,dword ptr [bp-6]
mov bx,word ptr es:[bx+6]
imul bx,bx,74
mov word ptr DGROUP:__tasks[bx+4],-1
;
; pt->iParent = 0; /* We don't keep this because the parent
;
?debug L 225
les bx,dword ptr [bp-6]
mov word ptr es:[bx+6],0
;
; * may die.
; */
; pidParent = ptParent->pid;
;
?debug L 228
les bx,dword ptr DGROUP:ptParent
mov ax,word ptr es:[bx+2]
mov word ptr DGROUP:pidParent,ax
;
; pidChild = 0;
;
?debug L 229
mov word ptr DGROUP:pidChild,0
;
; if ((iNew = WinExec(pchCommand, SW_SHOW)) < 32)
;
?debug L 230
push word ptr [bp-8]
push word ptr [bp-10]
push 5
call far ptr WINEXEC
mov word ptr [bp-12],ax
cmp ax,32
jl @@0
jmp @3@674
@@0:
;
; {
; ptParent->nError = aiExecErrors[iNew];
;
?debug L 232
mov bx,word ptr [bp-12]
add bx,bx
mov ax,word ptr DGROUP:aiExecErrors[bx]
les bx,dword ptr DGROUP:ptParent
mov word ptr es:[bx+62],ax
;
; ptParent->iFledgeling = -1;
;
?debug L 233
les bx,dword ptr DGROUP:ptParent
mov word ptr es:[bx+4],-1
;
; ptNext = 0;
;
?debug L 234
mov word ptr DGROUP:ptNext+2,0
mov word ptr DGROUP:ptNext,0
;
; task_is_dead(pt - _tasks);
;
?debug L 235
push 0
push 74
mov ax,word ptr [bp-6]
xor dx,dx
sub ax,offset DGROUP:__tasks
sbb dx,0
push dx
push ax
call far ptr F_LDIV@
push ax
call far ptr task_is_dead
pop cx
;
; htaskParent = 0;
;
?debug L 236
mov word ptr DGROUP:htaskParent,0
;
; pt->nFlags &= ~TF_EXEC;
;
?debug L 237
les bx,dword ptr [bp-6]
and word ptr es:[bx+60],-3
;
; pt->nError = ENOENT;
;
?debug L 238
les bx,dword ptr [bp-6]
mov word ptr es:[bx+62],2
;
; tkern_wakeup_call();
;
?debug L 239
call far ptr _tkern_wakeup_call
;
; MessageBox(0, "WinExec returned an error", 0, MB_OK);
;
?debug L 240
push 0
push ds
push offset DGROUP:s@+79
push 0
push 0
push 0
call far ptr MESSAGEBOX
;
; nTKExecOut++;
;
?debug L 241
inc word ptr DGROUP:_nTKExecOut
@3@646:
;
; return -1;
;
?debug L 242
mov ax,-1
jmp @3@1010
@3@674:
;
; }
; free(pchCommand);
;
?debug L 244
push word ptr [bp-8]
push word ptr [bp-10]
call far ptr _free
add sp,4
;
; if (ptNext != pt)
;
?debug L 245
mov dx,word ptr DGROUP:ptNext+2
mov ax,word ptr DGROUP:ptNext
cmp dx,word ptr [bp-4]
jne short @3@730
cmp ax,word ptr [bp-6]
je short @3@758
@3@730:
;
; MessageBox(0, "ptNext has been tampered with (!= pt)", 0, MB_OK);
;
?debug L 246
push 0
push ds
push offset DGROUP:s@+105
push 0
push 0
push 0
call far ptr MESSAGEBOX
@3@758:
;
; if (ptNext != ptLast)
;
?debug L 247
mov dx,word ptr DGROUP:ptNext+2
mov ax,word ptr DGROUP:ptNext
cmp dx,word ptr DGROUP:ptLast+2
jne short @3@814
cmp ax,word ptr DGROUP:ptLast
je short @3@842
@3@814:
;
; MessageBox(0, "ptNext does not match ptLast in tkexec", 0, MB_OK);
;
?debug L 248
push 0
push ds
push offset DGROUP:s@+143
push 0
push 0
push 0
call far ptr MESSAGEBOX
@3@842:
;
; ptParent->nChildren++;
;
?debug L 249
les bx,dword ptr DGROUP:ptParent
inc word ptr es:[bx+8]
;
; ptNext = 0;
;
?debug L 250
mov word ptr DGROUP:ptNext+2,0
mov word ptr DGROUP:ptNext,0
;
; htaskParent = 0;
;
?debug L 251
mov word ptr DGROUP:htaskParent,0
;
; tkern_wakeup_call();
;
?debug L 252
call far ptr _tkern_wakeup_call
;
; pt->nFlags &= ~TF_EXEC;
;
?debug L 253
les bx,dword ptr [bp-6]
and word ptr es:[bx+60],-3
;
; if (pt->hTask == HTASK_FLEDGELING)
;
?debug L 254
les bx,dword ptr [bp-6]
cmp word ptr es:[bx],-1
jne short @3@898
;
; {
; MessageBox(0, "Task has not registered", 0, MB_OK);
;
?debug L 256
push 0
push ds
push offset DGROUP:s@+182
push 0
push 0
push 0
call far ptr MESSAGEBOX
;
; ptParent->iFledgeling = -1;
;
?debug L 257
les bx,dword ptr DGROUP:ptParent
mov word ptr es:[bx+4],-1
;
; task_is_dead(pt - _tasks);
;
?debug L 258
push 0
push 74
mov ax,word ptr [bp-6]
xor dx,dx
sub ax,offset DGROUP:__tasks
sbb dx,0
push dx
push ax
call far ptr F_LDIV@
push ax
call far ptr task_is_dead
pop cx
;
; }
;
?debug L 259
jmp short @3@954
@3@898:
;
; else if (pt->hTask == 0)
;
?debug L 260
les bx,dword ptr [bp-6]
cmp word ptr es:[bx],0
jne short @3@954
;
; {
; MessageBox(0, "Task entry has null hTask", 0, MB_OK);
;
?debug L 262
push 0
push ds
push offset DGROUP:s@+206
push 0
push 0
push 0
call far ptr MESSAGEBOX
@3@954:
;
; }
; nTKExecOut++;
;
?debug L 264
inc word ptr DGROUP:_nTKExecOut
;
; return pidChild;
;
?debug L 265
mov ax,word ptr DGROUP:pidChild
jmp short @3@1010
@3@1010:
;
; }
;
?debug L 266
lea sp,word ptr [bp-2]
pop ds
pop bp
dec bp
ret
?debug C E31D000400160200
?debug C E31F047461736B4A001E03
?debug C E3200028001A04
?debug C E321000400161D00
?debug C E32300000023010500
?debug C E322000400162300
?debug C E31E000400161F00
?debug C E604694E65770402F4FF00000A706368436F6D6D+
?debug C 616E641D02F6FF00000270741E02FAFF00000770+
?debug C 6368506174681B0A06000000067661417267731C+
?debug C 0A0A000000057661456E761C0A0E0000000A7063+
?debug C 68436D644C696E651B0A12000000
?debug E
?debug E
_tkern_exec endp
;
; tkern_wait(union wait *wstatus)
;
?debug L 286
assume cs:PROCESS_TEXT,ds:DGROUP
_tkern_wait proc far
?debug B
mov ax,DGROUP
inc bp
push bp
mov bp,sp
push ds
mov ds,ax
sub sp,10
push si
?debug C E325047761697404001F12
?debug C E3260004001E16
?debug C E3270004001E1B
?debug C E324000400162500
?debug C E60777737461747573240A06000000
?debug B
;
; {
; int i;
; short pid;
;
; struct task *pt;
; struct task *ptParent;
;
; pt = GetTaskInfo();
;
?debug L 294
push cs
call near ptr _GetTaskInfo
mov word ptr [bp-6],dx
mov word ptr [bp-8],ax
;
;
; /* Fledgelings cannot be parents */
; for (ptParent = pt;
;
?debug L 297
mov dx,word ptr [bp-6]
mov ax,word ptr [bp-8]
mov word ptr [bp-10],dx
jmp short @4@86
@4@58:
;
; ptParent->hTask == HTASK_FLEDGELING;
; ptParent = _tasks + ptParent->iParent);
;
?debug L 299
les bx,dword ptr [bp-12]
mov ax,word ptr es:[bx+6]
imul ax,ax,74
add ax,offset DGROUP:__tasks
mov word ptr [bp-10],ds
@4@86:
mov word ptr [bp-12],ax
?debug L 298
les bx,dword ptr [bp-12]
cmp word ptr es:[bx],-1
je short @4@58
;
;
; /* If the parent is childless, return immediately */
; if (!ptParent->nChildren)
;
?debug L 302
les bx,dword ptr [bp-12]
cmp word ptr es:[bx+8],0
jne short @4@198
jmp @4@506
@4@198:
jmp short @4@254
@4@226:
;
; return 0;
;
; /* Wait until the parent has dead children */
; while (!ptParent->nZombies)
; GetMessages(pt);
;
?debug L 307
push word ptr [bp-6]
push word ptr [bp-8]
call far ptr _GetMessages
add sp,4
@4@254:
?debug L 306
les bx,dword ptr [bp-12]
cmp word ptr es:[bx+10],0
je short @4@226
;
;
; /* Reap the first dead child we encounter and return its pid */
; for (i = 0; i < nZombies; i++)
;
?debug L 310
xor si,si
jmp @4@478
@4@310:
;
; {
; if (_zombies[i].pidParent == ptParent->pid)
;
?debug L 312
mov bx,si
imul bx,bx,12
mov ax,word ptr DGROUP:__zombies[bx+2]
les bx,dword ptr [bp-12]
cmp ax,word ptr es:[bx+2]
jne short @4@450
;
; {
; pid = _zombies[i].pid;
;
?debug L 314
mov bx,si
imul bx,bx,12
mov ax,word ptr DGROUP:__zombies[bx]
mov word ptr [bp-4],ax
;
; wstatus->w_status = 0;
;
?debug L 315
les bx,dword ptr [bp+6]
mov word ptr es:[bx+2],0
mov word ptr es:[bx],0
;
; wstatus->w_retcode = _zombies[i].nRetCode;
;
?debug L 316
mov bx,si
imul bx,bx,12
mov al,byte ptr DGROUP:__zombies[bx+10]
and ax,255
les bx,dword ptr [bp+6]
and byte ptr es:[bx+2],0
or byte ptr es:[bx+2],al
;
; if (i < nZombies - 1)
;
?debug L 317
mov ax,word ptr DGROUP:nZombies
dec ax
cmp ax,si
jle short @4@394
;
; _zombies[i] = _zombies[nZombies - 1];
;
?debug L 318
mov ax,si
imul ax,ax,12
add ax,offset DGROUP:__zombies
push ds
push ax
mov ax,word ptr DGROUP:nZombies
imul ax,ax,12
add ax,offset DGROUP:__zombies-12
push ds
push ax
mov cx,12
call far ptr F_SCOPY@
@4@394:
;
; nZombies--;
;
?debug L 319
dec word ptr DGROUP:nZombies
;
; ptParent->nZombies--;
;
?debug L 320
les bx,dword ptr [bp-12]
dec word ptr es:[bx+10]
;
; ptParent->nChildren--;
;
?debug L 321
les bx,dword ptr [bp-12]
dec word ptr es:[bx+8]
;
; return pid;
;
?debug L 322
mov ax,word ptr [bp-4]
jmp short @4@534
@4@450:
?debug L 310
inc si
@4@478:
cmp si,word ptr DGROUP:nZombies
jge @@1
jmp @4@310
@@1:
@4@506:
;
; }
; }
; return 0;
;
?debug L 325
xor ax,ax
jmp short @4@534
@4@534:
;
; }
;
?debug L 326
pop si
lea sp,word ptr [bp-2]
pop ds
pop bp
dec bp
ret
?debug C E6087074506172656E741E02F4FF00000270741E+
?debug C 02F8FF0000037069640402FCFF00000169040406+
?debug C 00000777737461747573240A06000000
?debug E
?debug E
_tkern_wait endp
;
; tkern_wait3(union wait *wstatus,
;
?debug L 333
assume cs:PROCESS_TEXT,ds:DGROUP
_tkern_wait3 proc far
?debug B
mov ax,DGROUP
inc bp
push bp
mov bp,sp
push ds
mov ds,ax
sub sp,10
push si
?debug C E3290672757361676502001E20
?debug C E328000400162900
?debug C E605705A65726F280A0C000000066E466C616773+
?debug C 040A0A0000000777737461747573240A06000000
?debug B
;
; int nFlags,
; struct rusage *pZero)
; {
; int i;
; short pid;
; struct task *pt;
; struct task *ptParent;
;
; pt = GetTaskInfo();
;
?debug L 342
push cs
call near ptr _GetTaskInfo
mov word ptr [bp-6],dx
mov word ptr [bp-8],ax
;
;
; if (pZero)
;
?debug L 344
mov ax,word ptr [bp+12]
or ax,word ptr [bp+14]
je short @5@114
;
; {
; pt->nError = EINVAL;
;
?debug L 346
les bx,dword ptr [bp-8]
mov word ptr es:[bx+62],19
;
; return -1;
;
?debug L 347
mov ax,-1
jmp @5@702
@5@114:
;
; }
;
; /* Fledgelings cannot be parents */
; for (ptParent = pt;
;
?debug L 351
mov dx,word ptr [bp-6]
mov ax,word ptr [bp-8]
mov word ptr [bp-10],dx
jmp short @5@170
@5@142:
;
; ptParent->hTask == HTASK_FLEDGELING;
; ptParent = _tasks + ptParent->iParent);
;
?debug L 353
les bx,dword ptr [bp-12]
mov ax,word ptr es:[bx+6]
imul ax,ax,74
add ax,offset DGROUP:__tasks
mov word ptr [bp-10],ds
@5@170:
mov word ptr [bp-12],ax
?debug L 352
les bx,dword ptr [bp-12]
cmp word ptr es:[bx],-1
je short @5@142
;
;
; /* If the parent is childless, return immediately */
; if (!ptParent->nChildren)
;
?debug L 356
les bx,dword ptr [bp-12]
cmp word ptr es:[bx+8],0
jne short @5@282
;
; return 0;
;
?debug L 357
jmp @5@674
@5@282:
;
;
; /* If the WNOHANG flag is supplied, and there are no
; * zombies, return immediately
; */
; if (!ptParent->nZombies && (nFlags & WNOHANG))
;
?debug L 362
les bx,dword ptr [bp-12]
cmp word ptr es:[bx+10],0
jne short @5@366
test byte ptr [bp+10],1
je short @5@366
jmp @5@674
@5@366:
jmp short @5@422
@5@394:
;
; return 0;
;
; /* Since we don't have BSD jobs, we can't use WUNTRACED */
;
; /* Wait until the parent has dead children */
; while (!ptParent->nZombies)
; GetMessages(pt);
;
?debug L 369
push word ptr [bp-6]
push word ptr [bp-8]
call far ptr _GetMessages
add sp,4
@5@422:
?debug L 368
les bx,dword ptr [bp-12]
cmp word ptr es:[bx+10],0
je short @5@394
;
;
; /* Reap the first dead child we encounter and return its pid */
; for (i = 0; i < nZombies; i++)
;
?debug L 372
xor si,si
jmp @5@646
@5@478:
;
; {
; if (_zombies[i].pidParent == ptParent->pid)
;
?debug L 374
mov bx,si
imul bx,bx,12
mov ax,word ptr DGROUP:__zombies[bx+2]
les bx,dword ptr [bp-12]
cmp ax,word ptr es:[bx+2]
jne short @5@618
;
; {
; pid = _zombies[i].pid;
;
?debug L 376
mov bx,si
imul bx,bx,12
mov ax,word ptr DGROUP:__zombies[bx]
mov word ptr [bp-4],ax
;
; wstatus->w_status = 0;
;
?debug L 377
les bx,dword ptr [bp+6]
mov word ptr es:[bx+2],0
mov word ptr es:[bx],0
;
; wstatus->w_retcode = _zombies[i].nRetCode;
;
?debug L 378
mov bx,si
imul bx,bx,12
mov al,byte ptr DGROUP:__zombies[bx+10]
and ax,255
les bx,dword ptr [bp+6]
and byte ptr es:[bx+2],0
or byte ptr es:[bx+2],al
;
; if (i < nZombies - 1)
;
?debug L 379
mov ax,word ptr DGROUP:nZombies
dec ax
cmp ax,si
jle short @5@562
;
; _zombies[i] = _zombies[nZombies - 1];
;
?debug L 380
mov ax,si
imul ax,ax,12
add ax,offset DGROUP:__zombies
push ds
push ax
mov ax,word ptr DGROUP:nZombies
imul ax,ax,12
add ax,offset DGROUP:__zombies-12
push ds
push ax
mov cx,12
call far ptr F_SCOPY@
@5@562:
;
; nZombies--;
;
?debug L 381
dec word ptr DGROUP:nZombies
;
; ptParent->nZombies--;
;
?debug L 382
les bx,dword ptr [bp-12]
dec word ptr es:[bx+10]
;
; ptParent->nChildren--;
;
?debug L 383
les bx,dword ptr [bp-12]
dec word ptr es:[bx+8]
;
; return pid;
;
?debug L 384
mov ax,word ptr [bp-4]
jmp short @5@702
@5@618:
?debug L 372
inc si
@5@646:
cmp si,word ptr DGROUP:nZombies
jge @@2
jmp @5@478
@@2:
@5@674:
;
; }
; }
; return 0;
;
?debug L 387
xor ax,ax
jmp short @5@702
@5@702:
;
; }
;
?debug L 388
pop si
lea sp,word ptr [bp-2]
pop ds
pop bp
dec bp
ret
?debug C E6087074506172656E741E02F4FF00000270741E+
?debug C 02F8FF0000037069640402FCFF00000169040406+
?debug C 00000777737461747573240A06000000066E466C+
?debug C 616773040A0A00000005705A65726F280A0C0000+
?debug C 00
?debug E
?debug E
_tkern_wait3 endp
;
; tkern_waitpid( int pid,
;
?debug L 395
assume cs:PROCESS_TEXT,ds:DGROUP
_tkern_waitpid proc far
?debug B
mov ax,DGROUP
inc bp
push bp
mov bp,sp
push ds
mov ds,ax
sub sp,16
push si
push di
?debug C E6066E466C616773040A0C000000077773746174+
?debug C 7573240A0800000003706964040A06000000
?debug B
;
; union wait *wstatus,
; int nFlags)
; {
; int i;
; struct task *pt;
; struct task *ptParent;
; BOOL bZombie;
; int iEntry;
; struct tk_process *pProc;
; int nLastZombies = -1;
;
?debug L 405
mov word ptr [bp-18],-1
;
;
; pt = GetTaskInfo();
;
?debug L 407
push cs
call near ptr _GetTaskInfo
mov word ptr [bp-4],dx
mov word ptr [bp-6],ax
;
;
; /* Fledgelings cannot be parents */
; for (ptParent = pt;
;
?debug L 410
mov dx,word ptr [bp-4]
mov ax,word ptr [bp-6]
mov word ptr [bp-8],dx
jmp short @6@86
@6@58:
;
; ptParent->hTask == HTASK_FLEDGELING;
; ptParent = _tasks + ptParent->iParent);
;
?debug L 412
les bx,dword ptr [bp-10]
mov ax,word ptr es:[bx+6]
imul ax,ax,74
add ax,offset DGROUP:__tasks
mov word ptr [bp-8],ds
@6@86:
mov word ptr [bp-10],ax
?debug L 411
les bx,dword ptr [bp-10]
cmp word ptr es:[bx],-1
je short @6@58
;
;
; /* If the parent is childless, return immediately */
; if (!ptParent->nChildren)
;
?debug L 415
les bx,dword ptr [bp-10]
cmp word ptr es:[bx+8],0
jne short @6@198
;
; return 0;
;
?debug L 416
jmp @6@1402
@6@198:
;
;
; while (1)
; {
; /* Find the process entry for this child */
; if (pid)
;
?debug L 421
cmp word ptr [bp+6],0
jne @@3
jmp @6@1094
@@3:
;
; {
; if (ptParent->nZombies != nLastZombies)
;
?debug L 423
les bx,dword ptr [bp-10]
mov ax,word ptr es:[bx+10]
cmp ax,word ptr [bp-18]
jne @@4
jmp @6@982
@@4:
;
; {
; iEntry = -1;
;
?debug L 425
mov di,-1
;
; for (i = 0; iEntry == -1 && i < nProcesses; i++)
;
?debug L 426
xor si,si
jmp short @6@366
@6@282:
;
; {
; if (_process[i].pid == pid)
;
?debug L 428
mov bx,si
imul bx,bx,12
mov ax,word ptr DGROUP:__process[bx]
cmp ax,word ptr [bp+6]
jne short @6@338
;
; {
; iEntry = i;
;
?debug L 430
mov di,si
;
; bZombie = FALSE;
;
?debug L 431
mov word ptr [bp-12],0
;
; pProc = &_process[i];
;
?debug L 432
mov ax,si
imul ax,ax,12
add ax,offset DGROUP:__process
mov word ptr [bp-14],ds
mov word ptr [bp-16],ax
@6@338:
?debug L 426
inc si
@6@366:
cmp di,-1
jne short @6@422
cmp si,word ptr DGROUP:nProcesses
jl short @6@282
@6@422:
;
; }
; }
; for (i = 0; iEntry == -1 && i < nZombies; i++)
;
?debug L 435
xor si,si
jmp short @6@534
@6@450:
;
; {
; if (_zombies[i].pid == pid)
;
?debug L 437
mov bx,si
imul bx,bx,12
mov ax,word ptr DGROUP:__zombies[bx]
cmp ax,word ptr [bp+6]
jne short @6@506
;
; {
; iEntry = i;
;
?debug L 439
mov di,si
;
; bZombie = TRUE;
;
?debug L 440
mov word ptr [bp-12],1
;
; pProc = &_zombies[i];
;
?debug L 441
mov ax,si
imul ax,ax,12
add ax,offset DGROUP:__zombies
mov word ptr [bp-14],ds
mov word ptr [bp-16],ax
@6@506:
?debug L 435
inc si
@6@534:
cmp di,-1
jne short @6@590
cmp si,word ptr DGROUP:nZombies
jl short @6@450
@6@590:
;
; }
; }
; if (pProc->pidParent != ptParent->pid)
;
?debug L 444
les bx,dword ptr [bp-16]
mov ax,word ptr es:[bx+2]
les bx,dword ptr [bp-10]
cmp ax,word ptr es:[bx+2]
je short @6@674
;
; {
; pt->nError = EACCES;
;
?debug L 446
les bx,dword ptr [bp-6]
mov word ptr es:[bx+62],5
jmp short @6@730
jmp short @6@730
@6@674:
;
; return -1;
; }
; nLastZombies = ptParent->nZombies;
;
?debug L 449
les bx,dword ptr [bp-10]
mov ax,word ptr es:[bx+10]
mov word ptr [bp-18],ax
;
; if (iEntry == -1)
;
?debug L 450
cmp di,-1
jne short @6@758
;
; {
; pt->nError = EFAULT;
;
?debug L 452
les bx,dword ptr [bp-6]
mov word ptr es:[bx+62],14
@6@730:
;
; return -1;
;
?debug L 453
mov ax,-1
jmp @6@1486
@6@758:
;
; }
; if (!bZombie && (nFlags & WNOHANG))
;
?debug L 455
cmp word ptr [bp-12],0
jne short @6@842
test byte ptr [bp+12],1
je short @6@842
;
; return 0;
;
?debug L 456
jmp @6@1402
@6@842:
;
; if (bZombie)
;
?debug L 457
cmp word ptr [bp-12],0
je short @6@954
;
; {
; wstatus->w_status = 0;
;
?debug L 459
les bx,dword ptr [bp+8]
mov word ptr es:[bx+2],0
mov word ptr es:[bx],0
;
; wstatus->w_retcode = _zombies[iEntry].nRetCode;
;
?debug L 460
mov bx,di
imul bx,bx,12
mov al,byte ptr DGROUP:__zombies[bx+10]
and ax,255
les bx,dword ptr [bp+8]
and byte ptr es:[bx+2],0
or byte ptr es:[bx+2],al
;
; nZombies--;
;
?debug L 461
dec word ptr DGROUP:nZombies
;
; if (iEntry < nZombies)
;
?debug L 462
cmp di,word ptr DGROUP:nZombies
jge short @6@926
;
; _zombies[i] = _zombies[nZombies];
;
?debug L 463
mov ax,si
imul ax,ax,12
add ax,offset DGROUP:__zombies
push ds
push ax
mov ax,word ptr DGROUP:nZombies
imul ax,ax,12
add ax,offset DGROUP:__zombies
push ds
push ax
mov cx,12
call far ptr F_SCOPY@
@6@926:
;
; ptParent->nZombies--;
;
?debug L 464
les bx,dword ptr [bp-10]
dec word ptr es:[bx+10]
;
; ptParent->nChildren--;
;
?debug L 465
les bx,dword ptr [bp-10]
dec word ptr es:[bx+8]
jmp @6@1262
@6@954:
;
; return pid;
; }
; }
;
?debug L 468
jmp short @6@1066
@6@982:
;
; else if (!ptParent->nZombies && (nFlags & WNOHANG))
;
?debug L 469
les bx,dword ptr [bp-10]
cmp word ptr es:[bx+10],0
jne short @6@1066
test byte ptr [bp+12],1
je short @6@1066
jmp @6@1402
@6@1066:
;
; {
; return 0;
; }
; }
;
?debug L 473
jmp @6@1430
@6@1094:
;
; else if (ptParent->nZombies)
;
?debug L 474
les bx,dword ptr [bp-10]
cmp word ptr es:[bx+10],0
jne @@5
jmp @6@1374
@@5:
;
; {
; for (i = 0; i < nZombies; i++)
;
?debug L 476
xor si,si
jmp @6@1318
@6@1150:
;
; {
; if (_zombies[i].pidParent == ptParent->pid)
;
?debug L 478
mov bx,si
imul bx,bx,12
mov ax,word ptr DGROUP:__zombies[bx+2]
les bx,dword ptr [bp-10]
cmp ax,word ptr es:[bx+2]
jne short @6@1290
;
; {
; pid = _zombies[i].pid;
;
?debug L 480
mov bx,si
imul bx,bx,12
mov ax,word ptr DGROUP:__zombies[bx]
mov word ptr [bp+6],ax
;
; wstatus->w_status = 0;
;
?debug L 481
les bx,dword ptr [bp+8]
mov word ptr es:[bx+2],0
mov word ptr es:[bx],0
;
; wstatus->w_retcode = _zombies[i].nRetCode;
;
?debug L 482
mov bx,si
imul bx,bx,12
mov al,byte ptr DGROUP:__zombies[bx+10]
and ax,255
les bx,dword ptr [bp+8]
and byte ptr es:[bx+2],0
or byte ptr es:[bx+2],al
;
; if (i < nZombies - 1)
;
?debug L 483
mov ax,word ptr DGROUP:nZombies
dec ax
cmp ax,si
jle short @6@1234
;
; _zombies[i] = _zombies[nZombies - 1];
;
?debug L 484
mov ax,si
imul ax,ax,12
add ax,offset DGROUP:__zombies
push ds
push ax
mov ax,word ptr DGROUP:nZombies
imul ax,ax,12
add ax,offset DGROUP:__zombies-12
push ds
push ax
mov cx,12
call far ptr F_SCOPY@
@6@1234:
;
; nZombies--;
;
?debug L 485
dec word ptr DGROUP:nZombies
;
; ptParent->nZombies--;
;
?debug L 486
les bx,dword ptr [bp-10]
dec word ptr es:[bx+10]
;
; ptParent->nChildren--;
;
?debug L 487
les bx,dword ptr [bp-10]
dec word ptr es:[bx+8]
@6@1262:
;
; return pid;
;
?debug L 488
mov ax,word ptr [bp+6]
jmp short @6@1486
@6@1290:
?debug L 476
inc si
@6@1318:
cmp si,word ptr DGROUP:nZombies
jge @@6
jmp @6@1150
@@6:
;
; }
; }
; }
;
?debug L 491
jmp short @6@1430
@6@1374:
;
; else if (nFlags & WNOHANG)
;
?debug L 492
test byte ptr [bp+12],1
je short @6@1430
@6@1402:
;
; {
; return 0;
;
?debug L 494
xor ax,ax
jmp short @6@1486
@6@1430:
;
; }
;
; /* Wait until the parent has dead children */
; GetMessages(pt);
;
?debug L 498
push word ptr [bp-4]
push word ptr [bp-6]
call far ptr _GetMessages
add sp,4
jmp @6@198
@6@1486:
;
; }
; }
;
?debug L 500
pop di
pop si
lea sp,word ptr [bp-2]
pop ds
pop bp
dec bp
ret
?debug C E32B0A746B5F70726F636573730C001E22
?debug C E32A000400162B00
?debug C E60C6E4C6173745A6F6D626965730402EEFF0000+
?debug C 057050726F632A02F0FF00000669456E74727904+
?debug C 0407000007625A6F6D6269650402F4FF00000870+
?debug C 74506172656E741E02F6FF00000270741E02FAFF+
?debug C 00000169040406000003706964040A0600000007+
?debug C 77737461747573240A08000000066E466C616773+
?debug C 040A0C000000
?debug E
?debug E
_tkern_waitpid endp
;
; tkern_fork(void)
;
?debug L 514
assume cs:PROCESS_TEXT,ds:DGROUP
_tkern_fork proc far
?debug B
mov ax,DGROUP
inc bp
push bp
mov bp,sp
push ds
mov ds,ax
sub sp,4
push si
push di
?debug B
;
; {
; struct task *pt;
; int i, j;
;
; pt = GetTaskInfo();
;
?debug L 519
push cs
call near ptr _GetTaskInfo
mov word ptr [bp-4],dx
mov word ptr [bp-6],ax
;
; for (i = 0; i < TNTASK; i++)
;
?debug L 520
xor si,si
jmp short @7@142
@7@58:
;
; {
; if (!_tasks[i].hTask)
;
?debug L 522
mov bx,si
imul bx,bx,74
cmp word ptr DGROUP:__tasks[bx],0
jne short @7@114
;
; break;
;
?debug L 523
jmp short @7@170
@7@114:
?debug L 520
inc si
@7@142:
cmp si,20
jl short @7@58
@7@170:
;
; }
; if (i == TNTASK)
;
?debug L 525
cmp si,20
jne short @7@254
;
; {
; pt->nError = ENOMEM;
;
?debug L 527
les bx,dword ptr [bp-6]
mov word ptr es:[bx+62],8
;
; return -1;
;
?debug L 528
mov ax,-1
jmp @7@534
@7@254:
;
; }
; pt->iFledgeling = i;
;
?debug L 530
les bx,dword ptr [bp-6]
mov word ptr es:[bx+4],si
;
; _tasks[i].hTask = HTASK_FLEDGELING;
;
?debug L 531
mov bx,si
imul bx,bx,74
mov word ptr DGROUP:__tasks[bx],-1
;
; _tasks[i].iParent = (pt - _tasks);
;
?debug L 532
push 0
push 74
mov ax,word ptr [bp-6]
xor dx,dx
sub ax,offset DGROUP:__tasks
sbb dx,0
push dx
push ax
call far ptr F_LDIV@
mov bx,si
imul bx,bx,74
mov word ptr DGROUP:__tasks[bx+6],ax
;
; memcpy(_tasks[i].files, pt->files, sizeof(_tasks[i].files));
;
?debug L 533
push 40
mov ax,word ptr [bp-6]
add ax,12
push word ptr [bp-4]
push ax
push ds
mov ax,si
imul ax,ax,74
add ax,offset DGROUP:__tasks+12
push ax
call far ptr _memcpy
add sp,10
;
; if (_tasks[i].files[0] == -1 ||
;
?debug L 534
;
; _tasks[i].files[1] == -1 ||
; _tasks[i].files[2] == -1)
;
?debug L 536
mov bx,si
imul bx,bx,74
cmp word ptr DGROUP:__tasks[bx+12],-1
je short @7@338
mov bx,si
imul bx,bx,74
cmp word ptr DGROUP:__tasks[bx+14],-1
je short @7@338
mov bx,si
imul bx,bx,74
cmp word ptr DGROUP:__tasks[bx+16],-1
jne short @7@366
@7@338:
;
; MessageBox(0, "Files are all mixed up", 0, MB_OK);
;
?debug L 537
push 0
push ds
push offset DGROUP:s@+232
push 0
push 0
push 0
call far ptr MESSAGEBOX
@7@366:
;
; for (j = 0; j < UFILE_MAX; j++)
;
?debug L 538
xor di,di
jmp short @7@478
@7@394:
;
; {
; if (_tasks[i].files[j] != -1)
;
?debug L 540
mov bx,si
imul bx,bx,74
mov ax,di
add ax,ax
add bx,ax
cmp word ptr DGROUP:__tasks[bx+12],-1
je short @7@450
;
; _files[_tasks[i].files[j]].tf_cnt++;
;
?debug L 541
mov bx,si
imul bx,bx,74
mov ax,di
add ax,ax
add bx,ax
mov bx,word ptr DGROUP:__tasks[bx+12]
shl bx,3
inc word ptr DGROUP:__files[bx+2]
@7@450:
?debug L 538
inc di
@7@478:
cmp di,20
jl short @7@394
;
; }
; return 0; /* When we return, we are in the "child" process */
;
?debug L 543
xor ax,ax
jmp short @7@534
@7@534:
;
; }
;
?debug L 544
pop di
pop si
pop cx
pop cx
pop ds
pop bp
dec bp
ret
?debug C E6016A0404070000016904040600000270741E02+
?debug C FAFF0000
?debug E
?debug E
_tkern_fork endp
;
; tkern_total_zombies(void)
;
?debug L 548
assume cs:PROCESS_TEXT,ds:DGROUP
_tkern_total_zombies proc far
?debug B
mov ax,DGROUP
inc bp
push bp
mov bp,sp
push ds
mov ds,ax
?debug B
;
; {
; return nZombies;
;
?debug L 550
mov ax,word ptr DGROUP:nZombies
jmp short @8@58
@8@58:
;
; }
;
?debug L 551
pop ds
pop bp
dec bp
ret
?debug E
?debug E
_tkern_total_zombies endp
;
; tkern_list_zombies( struct tk_process *pList,
;
?debug L 554
assume cs:PROCESS_TEXT,ds:DGROUP
_tkern_list_zombies proc far
?debug B
mov ax,DGROUP
inc bp
push bp
mov bp,sp
push ds
mov ds,ax
push si
?debug C E6086E456E7472696573040A0A00000005704C69+
?debug C 73742A0A06000000
mov si,word ptr [bp+10]
?debug B
;
; int nEntries)
; {
;
; if (nZombies < nEntries)
;
?debug L 558
cmp word ptr DGROUP:nZombies,si
jge short @9@86
;
; nEntries = nZombies;
;
?debug L 559
mov si,word ptr DGROUP:nZombies
@9@86:
;
; memcpy(pList, _zombies, sizeof(*pList) * nEntries);
;
?debug L 560
mov ax,si
imul ax,ax,12
push ax
push ds
push offset DGROUP:__zombies
push word ptr [bp+8]
push word ptr [bp+6]
call far ptr _memcpy
add sp,10
;
; return nEntries;
;
?debug L 561
mov ax,si
jmp short @9@142
@9@142:
;
; }
;
?debug L 562
pop si
pop ds
pop bp
dec bp
ret
?debug C E605704C6973742A0A06000000086E456E747269+
?debug C 6573040C060000
?debug E
?debug E
_tkern_list_zombies endp
;
; tkern_get_process( HTASK hTask,
;
?debug L 568
assume cs:PROCESS_TEXT,ds:DGROUP
_tkern_get_process proc far
?debug B
mov ax,DGROUP
inc bp
push bp
mov bp,sp
push ds
mov ds,ax
?debug C E607746B5F70726F632A0A080000000568546173+
?debug C 6B180A06000000
?debug B
;
; struct tk_process *tk_proc)
; {
; int i;
;
; for (i = 0; i < nProcesses; i++)
;
?debug L 573
xor dx,dx
jmp short @10@170
@10@58:
;
; {
; if (_process[i].hTask == hTask)
;
?debug L 575
mov bx,dx
imul bx,bx,12
mov ax,word ptr DGROUP:__process[bx+4]
cmp ax,word ptr [bp+6]
jne short @10@142
;
; {
; *tk_proc = _process[i];
;
?debug L 577
push word ptr [bp+10]
push word ptr [bp+8]
mov ax,dx
imul ax,ax,12
add ax,offset DGROUP:__process
push ds
push ax
mov cx,12
call far ptr F_SCOPY@
;
; return _process[i].pid;
;
?debug L 578
mov bx,dx
imul bx,bx,12
mov ax,word ptr DGROUP:__process[bx]
jmp short @10@226
@10@142:
?debug L 573
inc dx
@10@170:
cmp dx,word ptr DGROUP:nProcesses
jl short @10@58
;
; }
; }
; return 0;
;
?debug L 581
xor ax,ax
jmp short @10@226
@10@226:
;
; }
;
?debug L 582
pop ds
pop bp
dec bp
ret
?debug C E60169040402000005685461736B180A06000000+
?debug C 07746B5F70726F632A0A08000000
?debug E
?debug E
_tkern_get_process endp
;
; tkern_register_program( int *argc,
;
?debug L 589
assume cs:PROCESS_TEXT,ds:DGROUP
_tkern_register_program proc far
?debug B
mov ax,DGROUP
inc bp
push bp
mov bp,sp
push ds
mov ds,ax
sub sp,114
push si
?debug C E32C000400160400
?debug C E32D000400162100
?debug C E604656E76702D0A0E00000004617267762D0A0A+
?debug C 00000004617267632C0A06000000
?debug B
;
; char ***argv,
; char ***envp)
; {
; int i;
; struct task *pt, *pt_;
; TASKENTRY te;
; int nTKExecIn_, nTKExecOut_;
; HTASK htaskParent_;
;
; TaskFindHandle(&te, GetCurrentTask());
;
?debug L 599
push ss
lea ax,word ptr [bp-56]
push ax
call far ptr GETCURRENTTASK
push ax
call far ptr TASKFINDHANDLE
;
; htaskParent_ = te.hTaskParent;
;
?debug L 600
mov si,word ptr [bp-50]
;
; if (htaskParent)
;
?debug L 601
cmp word ptr DGROUP:htaskParent,0
jne @@7
jmp @11@786
@@7:
;
; {
; nTKExecIn_ = nTKExecIn;
;
?debug L 603
mov ax,word ptr DGROUP:_nTKExecIn
mov word ptr [bp-14],ax
;
; nTKExecOut_ = nTKExecOut;
;
?debug L 604
mov ax,word ptr DGROUP:_nTKExecOut
mov word ptr [bp-16],ax
;
; /* Because of the way tkern_exec() is written,
; * the only way this can be true is if this
; * is the task spawned from the tkern_exec()
; */
; pt = ptNext;
;
?debug L 609
mov dx,word ptr DGROUP:ptNext+2
mov ax,word ptr DGROUP:ptNext
mov word ptr [bp-6],dx
mov word ptr [bp-8],ax
;
; pt->hTask = GetCurrentTask();
;
?debug L 610
call far ptr GETCURRENTTASK
les bx,dword ptr [bp-8]
mov word ptr es:[bx],ax
;
; for (i = 0; pt->argv[i]; i++);
;
?debug L 611
mov word ptr [bp-4],0
jmp short @11@114
@11@86:
inc word ptr [bp-4]
@11@114:
les bx,dword ptr [bp-8]
les bx,dword ptr es:[bx+52]
mov ax,word ptr [bp-4]
shl ax,2
add bx,ax
mov ax,word ptr es:[bx]
or ax,word ptr es:[bx+2]
jne short @11@86
;
; *argc = i;
;
?debug L 612
les bx,dword ptr [bp+6]
mov ax,word ptr [bp-4]
mov word ptr es:[bx],ax
;
; *argv = pt->argv;
;
?debug L 613
les bx,dword ptr [bp-8]
mov dx,word ptr es:[bx+54]
mov ax,word ptr es:[bx+52]
les bx,dword ptr [bp+10]
mov word ptr es:[bx+2],dx
mov word ptr es:[bx],ax
;
; *envp = pt->envp;
;
?debug L 614
les bx,dword ptr [bp-8]
mov dx,word ptr es:[bx+58]
mov ax,word ptr es:[bx+56]
les bx,dword ptr [bp+14]
mov word ptr es:[bx+2],dx
mov word ptr es:[bx],ax
;
; pt->pid = pidCurrent;
;
?debug L 615
les bx,dword ptr [bp-8]
mov ax,word ptr DGROUP:pidCurrent
mov word ptr es:[bx+2],ax
;
; if (pt->iFledgeling != -1)
;
?debug L 616
les bx,dword ptr [bp-8]
cmp word ptr es:[bx+4],-1
je short @11@198
;
; MessageBox(0, "iFledgeling is not -1", 0, MB_OK);
;
?debug L 617
push 0
push ds
push offset DGROUP:s@+255
push 0
push 0
push 0
call far ptr MESSAGEBOX
@11@198:
;
; if (pt->files[0] == -1)
;
?debug L 618
les bx,dword ptr [bp-8]
cmp word ptr es:[bx+12],-1
jne short @11@254
;
; MessageBox(0, "File 0 is -1", 0, MB_OK);
;
?debug L 619
push 0
push ds
push offset DGROUP:s@+277
push 0
push 0
push 0
call far ptr MESSAGEBOX
@11@254:
;
; if (!tkern_valid_file(0))
;
?debug L 620
push 0
call far ptr _tkern_valid_file
pop cx
or ax,ax
jne short @11@310
;
; {
; MessageBox(0, "File 0 is invalid", 0, MB_OK);
;
?debug L 622
push 0
push ds
push offset DGROUP:s@+290
push 0
push 0
push 0
call far ptr MESSAGEBOX
@11@310:
;
; }
; if (!tkern_valid_file(1))
;
?debug L 624
push 1
call far ptr _tkern_valid_file
pop cx
or ax,ax
jne short @11@366
;
; {
; MessageBox(0, "File 1 is invalid", 0, MB_OK);
;
?debug L 626
push 0
push ds
push offset DGROUP:s@+308
push 0
push 0
push 0
call far ptr MESSAGEBOX
@11@366:
;
; }
; if (!tkern_valid_file(2))
;
?debug L 628
push 2
call far ptr _tkern_valid_file
pop cx
or ax,ax
jne short @11@422
;
; {
; MessageBox(0, "File 2 is invalid", 0, MB_OK);
;
?debug L 630
push 0
push ds
push offset DGROUP:s@+326
push 0
push 0
push 0
call far ptr MESSAGEBOX
@11@422:
;
; }
; if (pt != ptLast)
;
?debug L 632
mov dx,word ptr [bp-6]
mov ax,word ptr [bp-8]
cmp dx,word ptr DGROUP:ptLast+2
jne short @11@478
cmp ax,word ptr DGROUP:ptLast
je short @11@506
@11@478:
?debug B
;
; {
; char achBuffer[60];
; sprintf(achBuffer, "ptNext: %p, ptLast: %p", pt, ptLast);
;
?debug L 635
push word ptr DGROUP:ptLast+2
push word ptr DGROUP:ptLast
push word ptr [bp-6]
push word ptr [bp-8]
push ds
push offset DGROUP:s@+344
push ss
lea ax,word ptr [bp-116]
push ax
call far ptr _sprintf
add sp,16
;
; MessageBox(0, achBuffer, 0, MB_OK);
;
?debug L 636
push 0
push ss
lea ax,word ptr [bp-116]
push ax
push 0
push 0
push 0
call far ptr MESSAGEBOX
;
; sprintf(achBuffer, "In: %d, Out: %d", nTKExecIn_, nTKExecOut_);
;
?debug L 637
push word ptr [bp-16]
push word ptr [bp-14]
push ds
push offset DGROUP:s@+367
push ss
lea ax,word ptr [bp-116]
push ax
call far ptr _sprintf
add sp,12
;
; MessageBox(0, achBuffer, 0, MB_OK);
;
?debug L 638
push 0
push ss
lea ax,word ptr [bp-116]
push ax
push 0
push 0
push 0
call far ptr MESSAGEBOX
@11@506:
?debug C E32E003C001A02
?debug C E6096163684275666665722E028CFF0000
?debug E
;
; }
; if (pt->hTask != GetCurrentTask())
;
?debug L 640
call far ptr GETCURRENTTASK
les bx,dword ptr [bp-8]
cmp ax,word ptr es:[bx]
je short @11@562
;
; MessageBox(0, "Somebody has touched my hTask!", 0, MB_OK);
;
?debug L 641
push 0
push ds
push offset DGROUP:s@+383
push 0
push 0
push 0
call far ptr MESSAGEBOX
@11@562:
;
; pt_ = GetTaskInfo();
;
?debug L 642
push cs
call near ptr _GetTaskInfo
mov word ptr [bp-10],dx
mov word ptr [bp-12],ax
;
; if (pt_ != pt)
;
?debug L 643
mov dx,word ptr [bp-10]
mov ax,word ptr [bp-12]
cmp dx,word ptr [bp-6]
jne short @11@618
cmp ax,word ptr [bp-8]
je short @11@646
@11@618:
?debug B
;
; {
; char achBuffer[60];
; MessageBox(0, "pt != GetTaskInfo()", 0, MB_OK);
;
?debug L 646
push 0
push ds
push offset DGROUP:s@+414
push 0
push 0
push 0
call far ptr MESSAGEBOX
;
; sprintf(achBuffer, "Created from %p", pt_->pchCreatedBy);
;
?debug L 647
les bx,dword ptr [bp-12]
push word ptr es:[bx+68]
push word ptr es:[bx+66]
push ds
push offset DGROUP:s@+434
push ss
lea ax,word ptr [bp-116]
push ax
call far ptr _sprintf
add sp,12
;
; MessageBox(0, achBuffer, 0, MB_OK);
;
?debug L 648
push 0
push ss
lea ax,word ptr [bp-116]
push ax
push 0
push 0
push 0
call far ptr MESSAGEBOX
;
; ((char **) &i)[2] = pt_->pchCreatedBy;
;
?debug L 649
les bx,dword ptr [bp-12]
mov dx,word ptr es:[bx+68]
mov ax,word ptr es:[bx+66]
mov word ptr [bp+6],dx
mov word ptr [bp+4],ax
;
; *(char *) 0 = 0;
;
?debug L 650
xor ax,ax
mov es,ax
mov byte ptr es:[0],0
@11@646:
?debug C E32F003C001A02
?debug C E6096163684275666665722F028CFF0000
?debug E
;
; }
; if (pt_ < pt)
;
?debug L 652
mov ax,word ptr [bp-12]
cmp ax,word ptr [bp-8]
jae short @11@702
;
; MessageBox(0, "GetTaskInfo() is smaller", 0, MB_OK);
;
?debug L 653
push 0
push ds
push offset DGROUP:s@+450
push 0
push 0
push 0
call far ptr MESSAGEBOX
jmp short @11@758
@11@702:
;
; else if (pt_ > pt)
;
?debug L 654
mov ax,word ptr [bp-12]
cmp ax,word ptr [bp-8]
jbe short @11@758
;
; MessageBox(0, "GetTaskInfo() is larger", 0, MB_OK);
;
?debug L 655
push 0
push ds
push offset DGROUP:s@+475
push 0
push 0
push 0
call far ptr MESSAGEBOX
@11@758:
;
; }
;
?debug L 656
jmp @11@1094
@11@786:
?debug B
;
; else
; {
; char achParent[60];
; if (htaskParent)
;
?debug L 660
cmp word ptr DGROUP:htaskParent,0
je short @11@842
;
; MessageBox(0, "Ummm... htaskParent exists", 0, MB_OK);
;
?debug L 661
push 0
push ds
push offset DGROUP:s@+499
push 0
push 0
push 0
call far ptr MESSAGEBOX
@11@842:
;
; if (!htaskParent_)
;
?debug L 662
or si,si
jne short @11@898
;
; MessageBox(0, "My te.htaskParent is 0", 0, MB_OK);
;
?debug L 663
push 0
push ds
push offset DGROUP:s@+526
push 0
push 0
push 0
call far ptr MESSAGEBOX
@11@898:
;
; sprintf(achParent, "I'm a bastard: htaskParent = %04x", htaskParent_);
;
?debug L 664
push si
push ds
push offset DGROUP:s@+549
push ss
lea ax,word ptr [bp-116]
push ax
call far ptr _sprintf
add sp,10
;
; MessageBox(0, achParent, 0, MB_OK);
;
?debug L 665
push 0
push ss
lea ax,word ptr [bp-116]
push ax
push 0
push 0
push 0
call far ptr MESSAGEBOX
;
; pt = GetTaskInfo();
;
?debug L 666
push cs
call near ptr _GetTaskInfo
mov word ptr [bp-6],dx
mov word ptr [bp-8],ax
;
; if (pt->argv)
;
?debug L 667
les bx,dword ptr [bp-8]
mov ax,word ptr es:[bx+52]
or ax,word ptr es:[bx+54]
je short @11@1038
;
; {
; for (i = 0; *pt->argv; i++);
;
?debug L 669
mov word ptr [bp-4],0
jmp short @11@982
@11@954:
inc word ptr [bp-4]
@11@982:
les bx,dword ptr [bp-8]
les bx,dword ptr es:[bx+52]
mov ax,word ptr es:[bx]
or ax,word ptr es:[bx+2]
jne short @11@954
;
; *argc = i;
;
?debug L 670
les bx,dword ptr [bp+6]
mov ax,word ptr [bp-4]
mov word ptr es:[bx],ax
;
; *argv = pt->argv;
;
?debug L 671
les bx,dword ptr [bp-8]
mov dx,word ptr es:[bx+54]
mov ax,word ptr es:[bx+52]
les bx,dword ptr [bp+10]
mov word ptr es:[bx+2],dx
mov word ptr es:[bx],ax
;
; *envp = pt->envp;
;
?debug L 672
les bx,dword ptr [bp-8]
mov dx,word ptr es:[bx+58]
mov ax,word ptr es:[bx+56]
les bx,dword ptr [bp+14]
mov word ptr es:[bx+2],dx
mov word ptr es:[bx],ax
;
; }
;
?debug L 673
jmp short @11@1066
@11@1038:
;
; else
; {
; *argc = 0;
;
?debug L 676
les bx,dword ptr [bp+6]
mov word ptr es:[bx],0
;
; *argv = 0;
;
?debug L 677
les bx,dword ptr [bp+10]
mov word ptr es:[bx+2],0
mov word ptr es:[bx],0
;
; *envp = 0;
;
?debug L 678
les bx,dword ptr [bp+14]
mov word ptr es:[bx+2],0
mov word ptr es:[bx],0
@11@1066:
;
; }
; pt->pid = pidCurrent;
;
?debug L 680
les bx,dword ptr [bp-8]
mov ax,word ptr DGROUP:pidCurrent
mov word ptr es:[bx+2],ax
@11@1094:
?debug C E330003C001A02
?debug C E609616368506172656E7430028CFF0000
?debug E
;
; }
;
; /* We need to flush all messages in the first task because if
; * that task exits without having yielded, TKFMANGR will miss
; * the exit notification.
; */
; if (!nTasks)
;
?debug L 687
cmp word ptr DGROUP:_nTasks,0
jne short @11@1150
;
; FlushMessages();
;
?debug L 688
call far ptr _FlushMessages
@11@1150:
;
; nTasks++;
;
?debug L 689
inc word ptr DGROUP:_nTasks
jmp short @11@1206
@11@1178:
;
; while (!hwndManager)
; GetMessages(pt);
;
?debug L 691
push word ptr [bp-6]
push word ptr [bp-8]
call far ptr _GetMessages
add sp,4
@11@1206:
?debug L 690
cmp word ptr DGROUP:_hwndManager,0
je short @11@1178
;
; }
;
?debug L 692
pop si
lea sp,word ptr [bp-2]
pop ds
pop bp
dec bp
ret
?debug C E3310C7461675441534B454E54525928001E29
?debug C E3330B48494E5354414E43455F5F02001E39
?debug C E332000200153304
?debug C E334000200150104
?debug C E335000A001A02
?debug C E60C687461736B506172656E745F18040600000B+
?debug C 6E544B457865634F75745F0402F0FF00000A6E54+
?debug C 4B45786563496E5F0402F2FF00000274653102C8+
?debug C FF00000370745F1E02F4FF00000270741E02F8FF+
?debug C 000001690402FCFF000004617267632C0A060000+
?debug C 0004617267762D0A0A00000004656E76702D0A0E+
?debug C 000000
?debug E
?debug E
_tkern_register_program endp
;
; task_is_dead( int iTask)
;
?debug L 695
assume cs:PROCESS_TEXT,ds:DGROUP
task_is_dead proc far
?debug B
mov ax,DGROUP
inc bp
push bp
mov bp,sp
push ds
mov ds,ax
push si
push di
?debug C E605695461736B040A06000000
mov si,word ptr [bp+6]
?debug B
;
; {
; int iFile;
;
; MessageBox(0, "Reaping task", 0, MB_OK);
;
?debug L 699
push 0
push ds
push offset DGROUP:s@+583
push 0
push 0
push 0
call far ptr MESSAGEBOX
;
; if (_tasks[iTask].iFledgeling != -1)
;
?debug L 700
mov bx,si
imul bx,bx,74
cmp word ptr DGROUP:__tasks[bx+4],-1
je short @12@86
;
; task_is_dead(_tasks[iTask].iFledgeling);
;
?debug L 701
mov bx,si
imul bx,bx,74
push word ptr DGROUP:__tasks[bx+4]
push cs
call near ptr task_is_dead
pop cx
@12@86:
;
; for (iFile = 0; iFile < UFILE_MAX; iFile++)
;
?debug L 702
xor di,di
jmp short @12@198
@12@114:
;
; if (_tasks[iTask].files[iFile] != -1)
;
?debug L 703
mov bx,si
imul bx,bx,74
mov ax,di
add ax,ax
add bx,ax
cmp word ptr DGROUP:__tasks[bx+12],-1
je short @12@170
;
; internal_close(iFile, iTask);
;
?debug L 704
push si
push di
call far ptr _internal_close
add sp,4
@12@170:
?debug L 702
inc di
@12@198:
cmp di,20
jl short @12@114
;
; if (_tasks[iTask].argv)
;
?debug L 705
mov bx,si
imul bx,bx,74
mov ax,word ptr DGROUP:__tasks[bx+52]
or ax,word ptr DGROUP:__tasks[bx+54]
je short @12@282
;
; {
; free(_tasks[iTask].argv);
;
?debug L 707
mov bx,si
imul bx,bx,74
push word ptr DGROUP:__tasks[bx+54]
push word ptr DGROUP:__tasks[bx+52]
call far ptr _free
add sp,4
;
; _tasks[iTask].argv = 0;
;
?debug L 708
mov bx,si
imul bx,bx,74
mov word ptr DGROUP:__tasks[bx+54],0
mov word ptr DGROUP:__tasks[bx+52],0
@12@282:
;
; }
; if (_tasks[iTask].envp)
;
?debug L 710
mov bx,si
imul bx,bx,74
mov ax,word ptr DGROUP:__tasks[bx+56]
or ax,word ptr DGROUP:__tasks[bx+58]
je short @12@338
;
; {
; free(_tasks[iTask].envp);
;
?debug L 712
mov bx,si
imul bx,bx,74
push word ptr DGROUP:__tasks[bx+58]
push word ptr DGROUP:__tasks[bx+56]
call far ptr _free
add sp,4
;
; _tasks[iTask].envp = 0;
;
?debug L 713
mov bx,si
imul bx,bx,74
mov word ptr DGROUP:__tasks[bx+58],0
mov word ptr DGROUP:__tasks[bx+56],0
@12@338:
;
; }
; _tasks[iTask].hTask = 0;
;
?debug L 715
mov bx,si
imul bx,bx,74
mov word ptr DGROUP:__tasks[bx],0
;
; _tasks[iTask].intrproc = 0;
;
?debug L 716
mov bx,si
imul bx,bx,74
mov word ptr DGROUP:__tasks[bx+72],0
mov word ptr DGROUP:__tasks[bx+70],0
;
; _tasks[iTask].nSignal = 0;
;
?debug L 717
mov bx,si
imul bx,bx,74
mov word ptr DGROUP:__tasks[bx+64],0
;
; _tasks[iTask].iFledgeling = -1;
;
?debug L 718
mov bx,si
imul bx,bx,74
mov word ptr DGROUP:__tasks[bx+4],-1
;
; }
;
?debug L 719
pop di
pop si
pop ds
pop bp
dec bp
ret
?debug C E6056946696C65040407000005695461736B040C+
?debug C 060000
?debug E
?debug E
task_is_dead endp
;
; tkern_program_started(HTASK htaskNew)
;
?debug L 723
assume cs:PROCESS_TEXT,ds:DGROUP
_tkern_program_started proc far
?debug B
mov ax,DGROUP
inc bp
push bp
mov bp,sp
push ds
mov ds,ax
sub sp,4
push si
push di
?debug C E608687461736B4E6577180A06000000
?debug B
;
; {
; short iEntry, i;
; short nPID;
; BOOL bOK;
;
; if (nProcesses == N_TKPROCS) // Should be impossible
;
?debug L 729
cmp word ptr DGROUP:nProcesses,100
jne short @13@86
;
; return; // Well what else can we do?
;
?debug L 730
jmp @13@618
@13@86:
;
; iEntry = nProcesses++;
;
?debug L 731
mov di,word ptr DGROUP:nProcesses
inc word ptr DGROUP:nProcesses
@13@114:
;
; do
; {
; nPID = nPIDNext;
;
?debug L 734
mov ax,word ptr DGROUP:nPIDNext
mov word ptr [bp-4],ax
;
; bOK = TRUE;
;
?debug L 735
mov word ptr [bp-6],1
;
; for (i = 0; i < nProcesses; i++)
;
?debug L 736
xor si,si
jmp short @13@226
@13@142:
;
; {
; if (_process[i].pid == nPID)
;
?debug L 738
mov bx,si
imul bx,bx,12
mov ax,word ptr DGROUP:__process[bx]
cmp ax,word ptr [bp-4]
jne short @13@198
;
; {
; bOK = FALSE;
;
?debug L 740
mov word ptr [bp-6],0
;
; break;
;
?debug L 741
jmp short @13@254
@13@198:
?debug L 736
inc si
@13@226:
cmp si,word ptr DGROUP:nProcesses
jl short @13@142
@13@254:
;
; }
; }
; if (bOK)
;
?debug L 744
cmp word ptr [bp-6],0
je short @13@422
;
; {
; for (i = 0; i < nZombies; i++)
;
?debug L 746
xor si,si
jmp short @13@394
@13@310:
;
; {
; if (_zombies[i].pid == nPID)
;
?debug L 748
mov bx,si
imul bx,bx,12
mov ax,word ptr DGROUP:__zombies[bx]
cmp ax,word ptr [bp-4]
jne short @13@366
;
; {
; bOK = FALSE;
;
?debug L 750
mov word ptr [bp-6],0
;
; break;
;
?debug L 751
jmp short @13@422
@13@366:
?debug L 746
inc si
@13@394:
cmp si,word ptr DGROUP:nZombies
jl short @13@310
@13@422:
;
; }
; }
; }
; inc_pid(&nPIDNext);
;
?debug L 755
push ds
push offset DGROUP:nPIDNext
push cs
call near ptr _inc_pid
add sp,4
;
; } while (!bOK);
;
?debug L 756
cmp word ptr [bp-6],0
je short @13@114
;
; _process[iEntry].pid = nPID;
;
?debug L 757
mov bx,di
imul bx,bx,12
mov ax,word ptr [bp-4]
mov word ptr DGROUP:__process[bx],ax
;
; _process[iEntry].hTask = htaskNew;
;
?debug L 758
mov bx,di
imul bx,bx,12
mov ax,word ptr [bp+6]
mov word ptr DGROUP:__process[bx+4],ax
;
; if (ptNext && !pidChild)
;
?debug L 759
mov ax,word ptr DGROUP:ptNext
or ax,word ptr DGROUP:ptNext+2
je short @13@562
cmp word ptr DGROUP:pidChild,0
jne short @13@562
;
; {
; _process[iEntry].pidParent = pidParent;
;
?debug L 761
mov bx,di
imul bx,bx,12
mov ax,word ptr DGROUP:pidParent
mov word ptr DGROUP:__process[bx+2],ax
;
; _process[iEntry].hTaskParent = htaskParent;
;
?debug L 762
mov bx,di
imul bx,bx,12
mov ax,word ptr DGROUP:htaskParent
mov word ptr DGROUP:__process[bx+6],ax
;
; pidChild = nPID;
;
?debug L 763
mov ax,word ptr [bp-4]
mov word ptr DGROUP:pidChild,ax
;
; _process[iEntry].iParent = ptParent - _tasks;
;
?debug L 764
push 0
push 74
mov ax,word ptr DGROUP:ptParent
xor dx,dx
sub ax,offset DGROUP:__tasks
sbb dx,0
push dx
push ax
call far ptr F_LDIV@
mov bx,di
imul bx,bx,12
mov word ptr DGROUP:__process[bx+8],ax
;
; }
;
?debug L 765
jmp short @13@590
@13@562:
;
; else
; {
; _process[iEntry].pidParent = 1;
;
?debug L 768
mov bx,di
imul bx,bx,12
mov word ptr DGROUP:__process[bx+2],1
;
; _process[iEntry].hTaskParent = 0;
;
?debug L 769
mov bx,di
imul bx,bx,12
mov word ptr DGROUP:__process[bx+6],0
;
; _process[iEntry].iParent = -1;
;
?debug L 770
mov bx,di
imul bx,bx,12
mov word ptr DGROUP:__process[bx+8],-1
@13@590:
;
; }
; pidCurrent = nPID;
;
?debug L 772
mov ax,word ptr [bp-4]
mov word ptr DGROUP:pidCurrent,ax
@13@618:
;
; }
;
?debug L 773
pop di
pop si
pop cx
pop cx
pop ds
pop bp
dec bp
ret
?debug C E603624F4B0402FAFF0000046E5049440402FCFF+
?debug C 0000016904040600000669456E74727904040700+
?debug C 0008687461736B4E6577180A06000000
?debug E
?debug E
_tkern_program_started endp
;
; tkern_program_dead( HTASK htaskCorpse,
;
?debug L 776
assume cs:PROCESS_TEXT,ds:DGROUP
_tkern_program_dead proc far
?debug B
mov ax,DGROUP
inc bp
push bp
mov bp,sp
push ds
mov ds,ax
sub sp,2
push si
push di
?debug C E6086E526574436F6465040A080000000B687461+
?debug C 736B436F72707365180A06000000
mov di,word ptr [bp+6]
?debug B
;
; int nRetCode)
; {
; int i;
; short nPID = 0;
;
?debug L 780
mov word ptr [bp-4],0
;
;
; /* First, clean up the tkern data on the task, along with
; * all open files.
; */
;
; for (i = 0; i < TNTASK; i++)
;
?debug L 786
xor si,si
jmp short @14@198
@14@58:
;
; {
; if (_tasks[i].hTask == htaskCorpse)
;
?debug L 788
mov bx,si
imul bx,bx,74
cmp word ptr DGROUP:__tasks[bx],di
jne short @14@170
;
; {
; task_is_dead(i);
;
?debug L 790
push si
push cs
call near ptr task_is_dead
pop cx
;
; nTasks--;
;
?debug L 791
dec word ptr DGROUP:_nTasks
;
; if (!nTasks)
;
?debug L 792
cmp word ptr DGROUP:_nTasks,0
jne short @14@142
;
; SendMessage(hwndManager, TKWM_ALLDONE, 0, 0);
;
?debug L 793
push word ptr DGROUP:_hwndManager
push 1033
push 0
push 0
push 0
call far ptr SENDMESSAGE
@14@142:
;
; break;
;
?debug L 794
jmp short @14@226
@14@170:
?debug L 786
inc si
@14@198:
cmp si,20
jl short @14@58
@14@226:
;
; }
; }
;
; /* Next, look for any children, and the process itself, in the process
; * list.
; */
; for (i = 0; i < nProcesses; i++)
;
?debug L 801
xor si,si
jmp @14@506
@14@254:
;
; {
; /* Change any orphaned processes to pidParent = 1, hTaskParent = 0 */
; if (_process[i].hTaskParent == htaskCorpse)
;
?debug L 804
mov bx,si
imul bx,bx,12
cmp word ptr DGROUP:__process[bx+6],di
jne short @14@310
;
; {
; /* A process has become orphaned */
; _process[i].hTaskParent = 0;
;
?debug L 807
mov bx,si
imul bx,bx,12
mov word ptr DGROUP:__process[bx+6],0
;
; _process[i].pidParent = 1;
;
?debug L 808
mov bx,si
imul bx,bx,12
mov word ptr DGROUP:__process[bx+2],1
;
; _process[i].iParent = -1;
;
?debug L 809
mov bx,si
imul bx,bx,12
mov word ptr DGROUP:__process[bx+8],-1
@14@310:
;
; }
;
; if (_process[i].hTask == htaskCorpse)
;
?debug L 812
mov bx,si
imul bx,bx,12
cmp word ptr DGROUP:__process[bx+4],di
je @@8
jmp @14@478
@@8:
;
; {
; /* This is the process entry for this task */
; nPID = _process[i].pid;
;
?debug L 815
mov bx,si
imul bx,bx,12
mov ax,word ptr DGROUP:__process[bx]
mov word ptr [bp-4],ax
;
;
; /* If there is room in the zombies table, and the process
; * has a living parent, copy the process entry to the zombies
; * table, and issue a wakeup call for any processes waiting
; * for children.
; *
; * note that if the process has no parents, failing to copy
; * it to the zombie table automatically causes it to be reaped.
; */
; if (nZombies < N_TKPROCS && _process[i].iParent != -1)
;
?debug L 825
cmp word ptr DGROUP:nZombies,100
jge short @14@422
mov bx,si
imul bx,bx,12
cmp word ptr DGROUP:__process[bx+8],-1
je short @14@422
;
; {
; _zombies[nZombies] = _process[i];
;
?debug L 827
mov ax,word ptr DGROUP:nZombies
imul ax,ax,12
add ax,offset DGROUP:__zombies
push ds
push ax
mov ax,si
imul ax,ax,12
add ax,offset DGROUP:__process
push ds
push ax
mov cx,12
call far ptr F_SCOPY@
;
; _zombies[nZombies].nRetCode = nRetCode;
;
?debug L 828
mov bx,word ptr DGROUP:nZombies
imul bx,bx,12
mov ax,word ptr [bp+8]
mov word ptr DGROUP:__zombies[bx+10],ax
;
; _tasks[_process[i].iParent].nZombies++;
;
?debug L 829
mov bx,si
imul bx,bx,12
mov bx,word ptr DGROUP:__process[bx+8]
imul bx,bx,74
inc word ptr DGROUP:__tasks[bx+10]
;
; nZombies++;
;
?debug L 830
inc word ptr DGROUP:nZombies
;
; tkern_wakeup_call();
;
?debug L 831
call far ptr _tkern_wakeup_call
@14@422:
;
; }
;
; nProcesses--;
;
?debug L 834
dec word ptr DGROUP:nProcesses
;
; if (i != nProcesses)
;
?debug L 835
cmp si,word ptr DGROUP:nProcesses
je short @14@478
;
; {
; _process[i] = _process[nProcesses];
;
?debug L 837
mov ax,si
imul ax,ax,12
add ax,offset DGROUP:__process
push ds
push ax
mov ax,word ptr DGROUP:nProcesses
imul ax,ax,12
add ax,offset DGROUP:__process
push ds
push ax
mov cx,12
call far ptr F_SCOPY@
;
; i--;
;
?debug L 838
dec si
@14@478:
?debug L 801
inc si
@14@506:
cmp si,word ptr DGROUP:nProcesses
jge @@9
jmp @14@254
@@9:
;
; }
; }
; }
;
; /* Search for any zombie children of the current process and reap them */
; for (i = 0; i < nZombies; i++)
;
?debug L 844
xor si,si
jmp short @14@674
@14@562:
;
; {
; if (_zombies[i].pidParent == nPID)
;
?debug L 846
mov bx,si
imul bx,bx,12
mov ax,word ptr DGROUP:__zombies[bx+2]
cmp ax,word ptr [bp-4]
jne short @14@646
;
; {
; nZombies--;
;
?debug L 848
dec word ptr DGROUP:nZombies
;
; if (i != nZombies)
;
?debug L 849
cmp si,word ptr DGROUP:nZombies
je short @14@646
;
; {
; _zombies[i] = _zombies[nZombies];
;
?debug L 851
mov ax,si
imul ax,ax,12
add ax,offset DGROUP:__zombies
push ds
push ax
mov ax,word ptr DGROUP:nZombies
imul ax,ax,12
add ax,offset DGROUP:__zombies
push ds
push ax
mov cx,12
call far ptr F_SCOPY@
;
; i--;
;
?debug L 852
dec si
@14@646:
?debug L 844
inc si
@14@674:
cmp si,word ptr DGROUP:nZombies
jl short @14@562
;
; }
; }
; }
; }
;
?debug L 856
pop di
pop si
pop cx
pop ds
pop bp
dec bp
ret
?debug C E6046E5049440402FCFF0000016904040600000B+
?debug C 687461736B436F72707365180C070000086E5265+
?debug C 74436F6465040A08000000
?debug E
?debug E
_tkern_program_dead endp
;
; process_init(void)
;
?debug L 860
assume cs:PROCESS_TEXT,ds:DGROUP
_process_init proc far
?debug B
mov ax,DGROUP
inc bp
push bp
mov bp,sp
push ds
mov ds,ax
sub sp,42
push si
push di
?debug B
;
; {
; TASKENTRY te;
; HTASK htaskNow;
; int i, j;
;
; for (i = 0; i < TNTASK; i++)
;
?debug L 866
xor si,si
jmp short @15@198
@15@58:
;
; {
; _tasks[i].hTask = 0;
;
?debug L 868
mov bx,si
imul bx,bx,74
mov word ptr DGROUP:__tasks[bx],0
;
; _tasks[i].argv = 0;
;
?debug L 869
mov bx,si
imul bx,bx,74
mov word ptr DGROUP:__tasks[bx+54],0
mov word ptr DGROUP:__tasks[bx+52],0
;
; _tasks[i].envp = 0;
;
?debug L 870
mov bx,si
imul bx,bx,74
mov word ptr DGROUP:__tasks[bx+58],0
mov word ptr DGROUP:__tasks[bx+56],0
;
; _tasks[i].pid = 0;
;
?debug L 871
mov bx,si
imul bx,bx,74
mov word ptr DGROUP:__tasks[bx+2],0
;
; _tasks[i].nChildren = 0;
;
?debug L 872
mov bx,si
imul bx,bx,74
mov word ptr DGROUP:__tasks[bx+8],0
;
; _tasks[i].nZombies = 0;
;
?debug L 873
mov bx,si
imul bx,bx,74
mov word ptr DGROUP:__tasks[bx+10],0
;
; _tasks[i].iFledgeling = -1;
;
?debug L 874
mov bx,si
imul bx,bx,74
mov word ptr DGROUP:__tasks[bx+4],-1
;
; for (j = 0; j < UFILE_MAX; j++)
;
?debug L 875
xor di,di
jmp short @15@142
@15@86:
;
; _tasks[i].files[j] = -1;
;
?debug L 876
mov bx,si
imul bx,bx,74
mov ax,di
add ax,ax
add bx,ax
mov word ptr DGROUP:__tasks[bx+12],-1
?debug L 875
inc di
@15@142:
cmp di,20
jl short @15@86
?debug L 866
inc si
@15@198:
cmp si,20
jl short @15@58
;
; }
; htaskNow = GetCurrentTask();
;
?debug L 878
call far ptr GETCURRENTTASK
mov word ptr [bp-4],ax
;
; te.dwSize = sizeof(TASKENTRY);
;
?debug L 879
mov word ptr [bp-42],0
mov word ptr [bp-44],40
;
; TaskFirst(&te);
;
?debug L 880
push ss
lea ax,word ptr [bp-44]
push ax
call far ptr TASKFIRST
;
; memset(_process, 0, sizeof(_process));
;
?debug L 881
push 1200
push 0
push ds
push offset DGROUP:__process
call far ptr _memset
add sp,8
;
; memset(_zombies, 0, sizeof(_zombies));
;
?debug L 882
push 1200
push 0
push ds
push offset DGROUP:__zombies
call far ptr _memset
add sp,8
@15@254:
;
; do
; {
; if (htaskNow == te.hTask)
;
?debug L 885
mov ax,word ptr [bp-4]
cmp ax,word ptr [bp-40]
jne short @15@310
;
; pidCurrent = nPIDNext;
;
?debug L 886
mov ax,word ptr DGROUP:nPIDNext
mov word ptr DGROUP:pidCurrent,ax
@15@310:
;
; _process[nProcesses].pid = nPIDNext++;
;
?debug L 887
mov bx,word ptr DGROUP:nProcesses
imul bx,bx,12
mov ax,word ptr DGROUP:nPIDNext
mov word ptr DGROUP:__process[bx],ax
inc word ptr DGROUP:nPIDNext
;
; _process[nProcesses].pidParent = 1;
;
?debug L 888
mov bx,word ptr DGROUP:nProcesses
imul bx,bx,12
mov word ptr DGROUP:__process[bx+2],1
;
; _process[nProcesses].hTaskParent = 0;
;
?debug L 889
mov bx,word ptr DGROUP:nProcesses
imul bx,bx,12
mov word ptr DGROUP:__process[bx+6],0
;
; _process[nProcesses].hTask = te.hTask;
;
?debug L 890
mov bx,word ptr DGROUP:nProcesses
imul bx,bx,12
mov ax,word ptr [bp-40]
mov word ptr DGROUP:__process[bx+4],ax
;
; _process[nProcesses].iParent = -1;
;
?debug L 891
mov bx,word ptr DGROUP:nProcesses
imul bx,bx,12
mov word ptr DGROUP:__process[bx+8],-1
;
; nProcesses++;
;
?debug L 892
inc word ptr DGROUP:nProcesses
;
; } while (TaskNext(&te));
;
?debug L 893
push ss
lea ax,word ptr [bp-44]
push ax
call far ptr TASKNEXT
or ax,ax
jne short @15@254
;
; }
;
?debug L 894
pop di
pop si
lea sp,word ptr [bp-2]
pop ds
pop bp
dec bp
ret
?debug C E6016A0404070000016904040600000868746173+
?debug C 6B4E6F771802FCFF00000274653102D4FF0000
?debug E
?debug E
_process_init endp
;
; tkern_kill( int pid,
;
?debug L 898
assume cs:PROCESS_TEXT,ds:DGROUP
_tkern_kill proc far
?debug B
mov ax,DGROUP
inc bp
push bp
mov bp,sp
push ds
mov ds,ax
sub sp,4
push si
push di
?debug C E6076E5369676E616C040A080000000370696404+
?debug C 0A06000000
mov di,word ptr [bp+6]
?debug B
;
; int nSignal)
; {
; int i;
; struct task *pt;
;
; pt = GetTaskInfo();
;
?debug L 904
push cs
call near ptr _GetTaskInfo
mov word ptr [bp-4],dx
mov word ptr [bp-6],ax
;
;
; for (i = 0; i < nProcesses; i++)
;
?debug L 906
xor si,si
jmp short @16@338
@16@58:
;
; {
; if (_process[i].pid == pid)
;
?debug L 908
mov bx,si
imul bx,bx,12
cmp word ptr DGROUP:__process[bx],di
jne short @16@310
;
; {
; switch(nSignal)
;
?debug L 910
mov bx,word ptr [bp+8]
cmp bx,14
ja short @16@226
add bx,bx
jmp word ptr cs:@16@C690[bx]
@16@170:
;
; {
; case 0:
; break;
;
?debug L 913
jmp short @16@282
@16@198:
;
; case 1:
; case 2:
; case 9:
; case 14:
; TerminateApp(_process[i].hTask, NO_UAE_BOX);
;
?debug L 918
mov bx,si
imul bx,bx,12
push word ptr DGROUP:__process[bx+4]
push 1
jmp short @16@254
@16@226:
;
; break;
;
; default:
; TerminateApp(_process[i].hTask, UAE_BOX);
;
?debug L 922
mov bx,si
imul bx,bx,12
push word ptr DGROUP:__process[bx+4]
push 0
@16@254:
call far ptr TERMINATEAPP
;
; break;
;
?debug L 923
jmp short @16@282
@16@282:
jmp short @16@422
@16@310:
?debug L 906
inc si
@16@338:
cmp si,word ptr DGROUP:nProcesses
jl short @16@58
;
; }
; return 0;
; }
; }
; for (i = 0; i < nZombies; i++)
;
?debug L 928
xor si,si
jmp short @16@478
@16@394:
;
; {
; if (_process[i].pid == pid)
;
?debug L 930
mov bx,si
imul bx,bx,12
cmp word ptr DGROUP:__process[bx],di
jne short @16@450
@16@422:
;
; return 0; /* Can't kill the undead */
;
?debug L 931
xor ax,ax
jmp short @16@562
@16@450:
?debug L 928
inc si
@16@478:
cmp si,word ptr DGROUP:nZombies
jl short @16@394
;
; }
; pt->nError = EFAULT;
;
?debug L 933
les bx,dword ptr [bp-6]
mov word ptr es:[bx+62],14
;
; return -1;
;
?debug L 934
mov ax,-1
jmp short @16@562
@16@562:
;
; }
;
?debug L 935
pop di
pop si
pop cx
pop cx
pop ds
pop bp
dec bp
ret
?debug C E60270741E02FAFF000001690404060000037069+
?debug C 64040C070000076E5369676E616C040A08000000
?debug E
?debug E
_tkern_kill endp
@16@C690 label word
dw @16@170
dw @16@198
dw @16@198
dw @16@226
dw @16@226
dw @16@226
dw @16@226
dw @16@226
dw @16@226
dw @16@198
dw @16@226
dw @16@226
dw @16@226
dw @16@226
dw @16@198
;
; tkern_register_sighandler(void far pascal (*_proc)(int))
;
?debug L 941
assume cs:PROCESS_TEXT,ds:DGROUP
_tkern_register_sighandler proc far
?debug B
mov ax,DGROUP
inc bp
push bp
mov bp,sp
push ds
mov ds,ax
sub sp,4
?debug C E33700000023010500
?debug C E336000400163700
?debug C E6055F70726F63360A06000000
?debug B
;
; {
; struct task *pt;
;
; pt = GetTaskInfo();
;
?debug L 945
push cs
call near ptr _GetTaskInfo
mov word ptr [bp-4],dx
mov word ptr [bp-6],ax
;
; pt->intrproc = _proc;
;
?debug L 946
les bx,dword ptr [bp-6]
mov dx,word ptr [bp+8]
mov ax,word ptr [bp+6]
mov word ptr es:[bx+72],dx
mov word ptr es:[bx+70],ax
;
; }
;
?debug L 947
pop cx
pop cx
pop ds
pop bp
dec bp
ret
?debug C E60270741E02FAFF0000055F70726F63360A0600+
?debug C 0000
?debug E
?debug E
_tkern_register_sighandler endp
;
; tkern_deliver_signal( int nDevice,
;
?debug L 950
assume cs:PROCESS_TEXT,ds:DGROUP
_tkern_deliver_signal proc far
?debug B
mov ax,DGROUP
inc bp
push bp
mov bp,sp
push ds
mov ds,ax
sub sp,2
push si
push di
?debug C E6076E5369676E616C040A0A000000056E46696C+
?debug C 65040A08000000076E446576696365040A060000+
?debug C 00
?debug B
;
; int nFile,
; int nSignal)
; {
; /* Find any task which is attached to the file and device,
; * and set its nSignal to the value supplied.
; */
;
; int idFile;
; int iTask;
; int iPTF;
;
; for (idFile = 0; idFile < TNFILE; idFile++)
;
?debug L 962
xor di,di
jmp short @18@170
@18@58:
;
; {
; if (_files[idFile].tf_dev == nDevice &&
;
?debug L 964
;
; _files[idFile].tf_id == nFile)
;
?debug L 965
mov bx,di
shl bx,3
mov ax,word ptr DGROUP:__files[bx+4]
cmp ax,word ptr [bp+6]
jne short @18@142
mov bx,di
shl bx,3
mov ax,word ptr DGROUP:__files[bx]
cmp ax,word ptr [bp+8]
jne short @18@142
;
; {
; break;
;
?debug L 967
jmp short @18@198
@18@142:
?debug L 962
inc di
@18@170:
cmp di,50
jl short @18@58
@18@198:
;
; }
; }
; if (idFile == TNFILE)
;
?debug L 970
cmp di,50
jne short @18@254
;
; return; /* Shouldn't be possible */
;
?debug L 971
jmp short @18@590
@18@254:
;
; for (iTask = 0; iTask < TNTASK; iTask++)
;
?debug L 972
xor si,si
jmp short @18@562
@18@282:
;
; {
; for (iPTF = 0; iPTF < UFILE_MAX; iPTF++)
;
?debug L 974
mov word ptr [bp-4],0
jmp short @18@506
@18@310:
;
; {
; if (_tasks[iTask].files[iPTF] == idFile)
;
?debug L 976
mov bx,si
imul bx,bx,74
mov ax,word ptr [bp-4]
add ax,ax
add bx,ax
cmp word ptr DGROUP:__tasks[bx+12],di
jne short @18@478
;
; {
; if (!_tasks[iTask].intrproc)
;
?debug L 978
mov bx,si
imul bx,bx,74
mov ax,word ptr DGROUP:__tasks[bx+70]
or ax,word ptr DGROUP:__tasks[bx+72]
jne short @18@394
;
; continue;
;
?debug L 979
jmp short @18@478
@18@394:
;
; _tasks[iTask].nSignal = nSignal;
;
?debug L 980
mov bx,si
imul bx,bx,74
mov ax,word ptr [bp+10]
mov word ptr DGROUP:__tasks[bx+64],ax
;
; if (!(_tasks[iTask].nFlags & TF_ASLEEP))
;
?debug L 981
mov bx,si
imul bx,bx,74
test byte ptr DGROUP:__tasks[bx+60],1
jne short @18@450
;
; continue;
;
?debug L 982
jmp short @18@478
@18@450:
;
; PostAppMessage(_tasks[iTask].hTask, TKWM_WAKEUP, 0, 0);
;
?debug L 983
mov bx,si
imul bx,bx,74
push word ptr DGROUP:__tasks[bx]
push 1124
push 0
push 0
push 0
call far ptr POSTAPPMESSAGE
@18@478:
?debug L 974
inc word ptr [bp-4]
@18@506:
cmp word ptr [bp-4],20
jl short @18@310
?debug L 972
inc si
@18@562:
cmp si,20
jl short @18@282
@18@590:
;
; }
; }
; }
; }
;
?debug L 987
pop di
pop si
pop cx
pop ds
pop bp
dec bp
ret
?debug C E604695054460402FCFF000005695461736B0404+
?debug C 06000006696446696C650404070000076E446576+
?debug C 696365040A06000000056E46696C65040A080000+
?debug C 00076E5369676E616C040A0A000000
?debug E
?debug E
_tkern_deliver_signal endp
PROCESS_TEXT ends
_BSS segment word public 'BSS'
__tasks label word
db 1480 dup (?)
__process label word
db 1200 dup (?)
__zombies label word
db 1200 dup (?)
pidCurrent label word
db 2 dup (?)
?debug C E9
?debug C FA00000000
_BSS ends
_DATA segment word public 'DATA'
s@ label byte
db ' '
db 0
db 'Files are all mixed up in exec'
db 0
db 'Task is not a fledgeling'
db 0
db 'I set a NULL ptNext!'
db 0
db 'WinExec returned an error'
db 0
db 'ptNext has been tampered with (!= pt)'
db 0
db 'ptNext does not match ptLast in tkexec'
db 0
db 'Task has not registered'
db 0
db 'Task entry has null hTask'
db 0
db 'Files are all mixed up'
db 0
db 'iFledgeling is not -1'
db 0
db 'File 0 is -1'
db 0
db 'File 0 is invalid'
db 0
db 'File 1 is invalid'
db 0
db 'File 2 is invalid'
db 0
db 'ptNext: %p, ptLast: %p'
db 0
db 'In: %d, Out: %d'
db 0
db 'Somebody has touched my hTask!'
db 0
db 'pt != GetTaskInfo()'
db 0
db 'Created from %p'
db 0
db 'GetTaskInfo() is smaller'
db 0
db 'GetTaskInfo() is larger'
db 0
db 'Ummm... htaskParent exists'
db 0
db 'My te.htaskParent is 0'
db 0
db 'I'
db 39
db 'm a bastard: htaskParent = %04x'
db 0
db 'Reaping task'
db 0
_DATA ends
PROCESS_TEXT segment word public 'CODE'
PROCESS_TEXT ends
_s@ equ s@
extrn _sprintf:far
extrn WINEXEC:far
extrn GETCURRENTTASK:far
extrn SENDMESSAGE:far
extrn POSTAPPMESSAGE:far
extrn MESSAGEBOX:far
extrn TASKFIRST:far
extrn TASKNEXT:far
extrn TASKFINDHANDLE:far
extrn TERMINATEAPP:far
extrn _free:far
extrn _malloc:far
extrn _memcpy:far
extrn _memset:far
extrn _strcat:far
extrn _strcpy:far
extrn _strlen:far
extrn __files:word
public __tasks
extrn _tkern_wakeup_call:far
extrn _GetMessages:far
extrn _FlushMessages:far
extrn _Copy_Array:far
public _GetTaskInfo
public _process_init
extrn _internal_close:far
public _nTasks
extrn _hwndManager:word
public __process
public __zombies
_nProcesses equ nProcesses
_nZombies equ nZombies
_ptNext equ ptNext
_ptLast equ ptLast
_ptParent equ ptParent
_htaskParent equ htaskParent
_pidParent equ pidParent
_pidChild equ pidChild
_pidCurrent equ pidCurrent
_nPIDNext equ nPIDNext
_task_is_dead equ task_is_dead
public _inc_pid
_aiExecErrors equ aiExecErrors
public _nTKExecIn
public _nTKExecOut
publicdll _tkern_exec
extrn F_LDIV@:far
publicdll _tkern_wait
extrn F_SCOPY@:far
publicdll _tkern_wait3
publicdll _tkern_waitpid
publicdll _tkern_fork
publicdll _tkern_total_zombies
publicdll _tkern_list_zombies
publicdll _tkern_get_process
extrn _tkern_valid_file:far
publicdll _tkern_register_program
publicdll _tkern_program_started
publicdll _tkern_program_dead
publicdll _tkern_kill
publicdll _tkern_register_sighandler
publicdll _tkern_deliver_signal
?debug C EA010C
?debug C E338000000231D0401
?debug C EB085F737072696E7466380000
?debug C E339000000230A0500
?debug C EB0757494E45584543390000
?debug C E33A00000023180500
?debug C EB0E47455443555252454E545441534B3A0000
?debug C E33B00000023060500
?debug C EB0B53454E444D4553534147453B0000
?debug C E33C00000023040500
?debug C EB0E504F53544150504D4553534147453C0000
?debug C E33D00000023040500
?debug C EB0A4D455353414745424F583D0000
?debug C E33E00000023040500
?debug C EB095441534B46495253543E0000
?debug C E33F00000023040500
?debug C EB085441534B4E4558543F0000
?debug C E34000000023040500
?debug C EB0E5441534B46494E4448414E444C45400000
?debug C E34100000023010500
?debug C EB0C5445524D494E415445415050410000
?debug C E34200000023010400
?debug C EB055F66726565420000
?debug C E343000000231C0400
?debug C EB075F6D616C6C6F63430000
?debug C E344000000231C0400
?debug C EB075F6D656D637079440000
?debug C E345000000231C0400
?debug C EB075F6D656D736574450000
?debug C E346000000231D0400
?debug C EB075F737472636174460000
?debug C E347000000231D0400
?debug C EB075F737472637079470000
?debug C E348000000230A0400
?debug C EB075F7374726C656E480000
?debug C E34A057466696C6508001E3B
?debug C E3490000001A4A
?debug C EB075F5F66696C6573490000
?debug C E34B00C8051A1F
?debug C EC075F5F7461736B734B000000
?debug C E34C00000023010400
?debug C EB125F746B65726E5F77616B6575705F63616C6C+
?debug C 4C0000
?debug C E34D00000023010400
?debug C EB0C5F4765744D657373616765734D0000
?debug C E34E00000023010400
?debug C EB0E5F466C7573684D657373616765734E0000
?debug C E34F00000023010400
?debug C EB0B5F436F70795F41727261794F0000
?debug C E350000000231E0400
?debug C EC0C5F4765745461736B496E666F50180000
?debug C E35100000023010400
?debug C EC0D5F70726F636573735F696E697451180000
?debug C E35200000023010400
?debug C EB0F5F696E7465726E616C5F636C6F7365520000
?debug C EC075F6E5461736B7304000000
?debug C E3540648574E445F5F02001E40
?debug C E353000200155404
?debug C EB0C5F68776E644D616E61676572530000
?debug C E35500B0041A2B
?debug C EC095F5F70726F6365737355000000
?debug C E35600B0041A2B
?debug C EC095F5F7A6F6D6269657356000000
?debug C E35700000023010400
?debug C E35800000023010400
?debug C EC085F696E635F70696458180000
?debug C E3590042001A04
?debug C EC0A5F6E544B45786563496E04000000
?debug C EC0B5F6E544B457865634F757404000000
?debug C E35A00000023040400
?debug C EC0B5F746B65726E5F657865635A180000
?debug C E35B00000023040500
?debug C EB07465F4C444956405B0000
?debug C E35C00000023040400
?debug C EC0B5F746B65726E5F776169745C180000
?debug C EB08465F53434F5059405B0000
?debug C E35D00000023040400
?debug C EC0C5F746B65726E5F77616974335D180000
?debug C E35E00000023040400
?debug C EC0E5F746B65726E5F776169747069645E180000
?debug C E35F00000023040400
?debug C EC0B5F746B65726E5F666F726B5F180000
?debug C E36000000023040400
?debug C EC145F746B65726E5F746F74616C5F7A6F6D6269+
?debug C 657360180000
?debug C E36100000023040400
?debug C EC135F746B65726E5F6C6973745F7A6F6D626965+
?debug C 7361180000
?debug C E36200000023040400
?debug C EC125F746B65726E5F6765745F70726F63657373+
?debug C 62180000
?debug C E36300000023040400
?debug C EB115F746B65726E5F76616C69645F66696C6563+
?debug C 0000
?debug C E36400000023010400
?debug C EC175F746B65726E5F72656769737465725F7072+
?debug C 6F6772616D64180000
?debug C E36500000023010400
?debug C EC165F746B65726E5F70726F6772616D5F737461+
?debug C 7274656465180000
?debug C E36600000023010400
?debug C EC135F746B65726E5F70726F6772616D5F646561+
?debug C 6466180000
?debug C E36700000023040400
?debug C EC0B5F746B65726E5F6B696C6C67180000
?debug C E36800000023010400
?debug C EC1A5F746B65726E5F72656769737465725F7369+
?debug C 6768616E646C657268180000
?debug C E36900000023010400
?debug C EC155F746B65726E5F64656C697665725F736967+
?debug C 6E616C69180000
?debug C E60A6E50726F6365737365730400000202000000+
?debug C 086E5A6F6D626965730400000204000000067074+
?debug C 4E6578741E000002060000000670744C6173741E+
?debug C 0000020A000000087074506172656E741E000002+
?debug C 0E0000000B687461736B506172656E7418000002+
?debug C 1200000009706964506172656E74040000021400+
?debug C 0000087069644368696C6404000002160000000A+
?debug C 70696443757272656E7404000003280F0000086E+
?debug C 5049444E65787404000002180000000C61694578+
?debug C 65634572726F7273590000021A00000004424F4F+
?debug C 4C0406000004425954450806000004574F52440A+
?debug C 0600000544574F52440C0600000455494E540A06+
?debug C 0000044C4F4E47060600000657504152414D0A06+
?debug C 0000064C504152414D06060000074C524553554C+
?debug C 5406060000054C505354521D060000064C504353+
?debug C 54521B060000054C50494E542C060000064C5056+
?debug C 4F49441C0600000648414E444C45340600000748+
?debug C 474C4F42414C3406000006484C4F43414C340600+
?debug C 000C474C4F42414C48414E444C45340600000B4C+
?debug C 4F43414C48414E444C45340600000441544F4D0A+
?debug C 0600000948494E5354414E43453206000007484D+
?debug C 4F44554C45320600000A4C504341544348425546+
?debug C 2C06000005485441534B18060000054846494C45+
?debug C 0406000007484744494F424A3406000008434F4C+
?debug C 4F525245460C0600000448574E44530600000954+
?debug C 41534B454E545259310600000673697A655F740A+
?debug C 0600000777636861725F740A0600000970747264+
?debug C 6966665F74060600000776615F6C6973741C0600+
?debug C 000B48494E5354414E43455F5F33070000074854+
?debug C 41534B5F5F190700000648574E445F5F54070000+
?debug C 0C7461675441534B454E54525931070000057466+
?debug C 696C654A070000047461736B1F0700000A746B5F+
?debug C 70726F636573732B070000047761697425070000+
?debug C 0672757361676529070000
?debug F task_is_dead 87 24 0 0
?debug C E20006756E7573656404C002000000
?debug C E20005685461736B18000370696404000B69466C+
?debug C 656467656C696E6704000769506172656E740400+
?debug C 096E4368696C6472656E0400086E5A6F6D626965+
?debug C 7304000566696C65732000046172677621000465+
?debug C 6E76702100066E466C6167730A00066E4572726F+
?debug C 720400076E5369676E616C04000C706368437265+
?debug C 6174656442791D0008696E747270726F6322C04A+
?debug C 000000
?debug C E20008775F737461747573060003775F54260003+
?debug C 775F5327C004000000
?debug C E20006775F706164300A0809775F526574636F64+
?debug C 650A010A775F436F726564756D700A0709775F54+
?debug C 65726D7369670AC004000000
?debug C E20806775F706164310A080B775F53746F706576+
?debug C 656E740A0809775F53746F707369670A0809775F+
?debug C 53746F7076616C0AC004000000
?debug C E2000872755F64756D6D7904C002000000
?debug C E20003706964040009706964506172656E740400+
?debug C 05685461736B18000B685461736B506172656E74+
?debug C 18000769506172656E740400086E526574436F64+
?debug C 6504C00C000000
?debug C E20006647753697A650C0005685461736B18000B+
?debug C 685461736B506172656E7418000568496E737432+
?debug C 0007684D6F64756C653200037753530A00037753+
?debug C 500A000977537461636B546F700A000D77537461+
?debug C 636B4D696E696D756D0A000C77537461636B426F+
?debug C 74746F6D0A000877634576656E74730A00066851+
?debug C 75657565340008737A4D6F64756C6535000A7750+
?debug C 53504F66667365740A0005684E65787434C02800+
?debug C 0000
?debug C E20006756E7573656404C002000000
?debug C E2000574665F696404000674665F636E74040006+
?debug C 74665F64657604000674665F656F6604C0080000+
?debug C 00
?debug C E20006756E7573656404C002000000
end